X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fbancache.cpp;h=2254a117b3f0aaeb972a3e18b1780b5e8eb3e5d1;hb=d555db40f4b39f10ad06c2449b42711c1e74105f;hp=472685f08099512ef3b3f99601664a2bd882eb1d;hpb=66d15c4a15d2bfbb2ef6fe22e5ae29f436fcb9ec;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/bancache.cpp b/src/bancache.cpp index 472685f08..2254a117b 100644 --- a/src/bancache.cpp +++ b/src/bancache.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * InspIRCd: (C) 2002-2008 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -29,6 +29,19 @@ BanCacheHit *BanCacheManager::AddHit(const std::string &ip, const std::string &t return b; } +BanCacheHit *BanCacheManager::AddHit(const std::string &ip, const std::string &type, const std::string &reason, time_t seconds) +{ + BanCacheHit *b; + + if (this->BanHash->find(ip) != this->BanHash->end()) // can't have two cache entries on the same IP, sorry.. + return NULL; + + b = new BanCacheHit(ServerInstance, ip, type, reason, seconds); + + this->BanHash->insert(std::make_pair(ip, b)); + return b; +} + BanCacheHit *BanCacheManager::GetHit(const std::string &ip) { BanCacheHash::iterator i = this->BanHash->find(ip);