diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bancache.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/bancache.h b/include/bancache.h index 6679a2c55..1edbbe5a1 100644 --- a/include/bancache.h +++ b/include/bancache.h @@ -14,4 +14,36 @@ #ifndef __BANCACHE_H #define __BANCACHE_H +#include <string> + +class CoreExport BanCacheHit : public classbase +{ + private: + public: + const std::string Type; + const std::string Reason; + const bool Banned; + const time_t Duration; + const time_t Creation; +} + +// must be defined after class BanCacheHit. +typedef nspace::hash_map<std::string, BanCacheHit *, nspace::hash<std::string> > BanCacheHash; + +class CoreExport BanCacheManager : public classbase +{ + private: + BanCacheHash *BanHash; + InspIRCd *ServerInstance; + public: + BanCacheHit *AddHit(const std::string &ip, bool banned, const std::string &reason); + BanCacheHit *GetHit(const std::string &ip); + + BanCacheManager(InspIRCd *Instance) + { + this->ServerInstance = Instance; + this->BanHash = new BanCacheHash(); + } +} + #endif |