diff options
-rw-r--r-- | include/bancache.h | 32 | ||||
-rw-r--r-- | src/bancache.cpp | 3 |
2 files changed, 35 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 diff --git a/src/bancache.cpp b/src/bancache.cpp index d54b26caf..0c5f00502 100644 --- a/src/bancache.cpp +++ b/src/bancache.cpp @@ -13,4 +13,7 @@ /* $Core: libIRCDbancache */ +#include "inspircd.h" +#include "bancache.h" + |