]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/bancache.h
Remote user messaging fixes
[user/henk/code/inspircd.git] / include / bancache.h
index b6e037f79dde8e955c3f5e99cceba6b2c75277ae..1d56decc11d2b897e2b20ab5fcc8bcef804aef06 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *         the file COPYING for details.
@@ -45,7 +45,7 @@ class CoreExport BanCacheHit : public classbase
                this->Type = type;
                this->Reason = reason;
                this->IP = ip;
-               this->Expiry = time(NULL) + 86400; // a day. this might seem long, but entries will be removed as glines/etc expire.
+               this->Expiry = ServerInstance->Time() + 86400; // a day. this might seem long, but entries will be removed as glines/etc expire.
        }
 
        // overridden to allow custom time
@@ -55,17 +55,17 @@ class CoreExport BanCacheHit : public classbase
                this->Type = type;
                this->Reason = reason;
                this->IP = ip;
-               this->Expiry = time(NULL) + seconds;
+               this->Expiry = ServerInstance->Time() + seconds;
        }
 };
 
 /* A container of ban cache items.
  * must be defined after class BanCacheHit.
  */
-#ifndef WIN32
-typedef nspace::hash_map<std::string, BanCacheHit*, nspace::hash<std::string> > BanCacheHash;
-#else
+#if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED)
 typedef nspace::hash_map<std::string, BanCacheHit*, nspace::hash_compare<std::string, std::less<std::string> > > BanCacheHash;
+#else
+typedef nspace::hash_map<std::string, BanCacheHit*, nspace::hash<std::string> > BanCacheHash;
 #endif
 
 /** A manager for ban cache, which allocates and deallocates and checks cached bans.
@@ -100,6 +100,10 @@ class CoreExport BanCacheManager : public classbase
                this->ServerInstance = Instance;
                this->BanHash = new BanCacheHash();
        }
+       ~BanCacheManager()
+       {
+               delete BanHash;
+       }
 
        void RehashCache();
 };