]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/xline.cpp
Cut down on debug on restart
[user/henk/code/inspircd.git] / src / xline.cpp
index 84c46592773c7fe94fd0a2f9ab4272d309875539..7b830f3194ccbd0a7c5fbfcb4e2b962554d6dbc5 100644 (file)
@@ -2,20 +2,15 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *               <Craig@chatspike.net>
- *     
- * Written by Craig Edwards, Craig McLure, and others.
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
  *
  * ---------------------------------------------------
  */
 
-using namespace std;
-
 #include "inspircd.h"
 #include "users.h"
 #include "modules.h"
@@ -52,40 +47,40 @@ bool DoneXLine(ServerConfig* conf, const char* tag)
        return true;
 }
 
-bool DoZLine(ServerConfig* conf, const char* tag, char** entries, void** values, int* types)
+bool DoZLine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types)
 {
-       char* reason = (char*)values[0];
-       char* ipmask = (char*)values[1];
+       const char* reason = values[0].GetString();
+       const char* ipmask = values[1].GetString();
        
        conf->GetInstance()->XLines->add_zline(0,"<Config>",reason,ipmask);
        conf->GetInstance()->Log(DEBUG,"Read Z line (badip tag): ipmask=%s reason=%s",ipmask,reason);
        return true;
 }
 
-bool DoQLine(ServerConfig* conf, const char* tag, char** entries, void** values, int* types)
+bool DoQLine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types)
 {
-       char* reason = (char*)values[0];
-       char* nick = (char*)values[1];
+       const char* reason = values[0].GetString();
+       const char* nick = values[1].GetString();
        
        conf->GetInstance()->XLines->add_qline(0,"<Config>",reason,nick);
        conf->GetInstance()->Log(DEBUG,"Read Q line (badnick tag): nick=%s reason=%s",nick,reason);
        return true;
 }
 
-bool DoKLine(ServerConfig* conf, const char* tag, char** entries, void** values, int* types)
+bool DoKLine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types)
 {
-       char* reason = (char*)values[0];
-       char* host = (char*)values[1];
+       const char* reason = values[0].GetString();
+       const char* host = values[1].GetString();
        
        conf->GetInstance()->XLines->add_kline(0,"<Config>",reason,host);
        conf->GetInstance()->Log(DEBUG,"Read K line (badhost tag): host=%s reason=%s",host,reason);
        return true;
 }
 
-bool DoELine(ServerConfig* conf, const char* tag, char** entries, void** values, int* types)
+bool DoELine(ServerConfig* conf, const char* tag, char** entries, ValueList &values, int* types)
 {
-       char* reason = (char*)values[0];
-       char* host = (char*)values[1];
+       const char* reason = values[0].GetString();
+       const char* host = values[1].GetString();
        
        conf->GetInstance()->XLines->add_eline(0,"<Config>",reason,host);
        conf->GetInstance()->Log(DEBUG,"Read E line (exception tag): host=%s reason=%s",host,reason);
@@ -599,14 +594,14 @@ void XLineManager::expire_lines()
        while ((glines.size()) && (current > (*glines.begin())->expiry))
        {
                std::vector<GLine*>::iterator i = glines.begin();
-               ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed G-Line %s (set by %s %d seconds ago)",(*i)->hostmask,(*i)->source,(*i)->duration);
+               ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed G-Line %s@%s (set by %s %d seconds ago)",(*i)->identmask,(*i)->hostmask,(*i)->source,(*i)->duration);
                glines.erase(i);
        }
 
        while ((elines.size()) && (current > (*elines.begin())->expiry))
        {
                std::vector<ELine*>::iterator i = elines.begin();
-               ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed E-Line %s (set by %s %d seconds ago)",(*i)->hostmask,(*i)->source,(*i)->duration);
+               ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed E-Line %s@%s (set by %s %d seconds ago)",(*i)->identmask,(*i)->hostmask,(*i)->source,(*i)->duration);
                elines.erase(i);
        }
 
@@ -620,7 +615,7 @@ void XLineManager::expire_lines()
        while ((klines.size()) && (current > (*klines.begin())->expiry))
        {
                std::vector<KLine*>::iterator i = klines.begin();
-               ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed K-Line %s (set by %s %d seconds ago)",(*i)->hostmask,(*i)->source,(*i)->duration);
+               ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed K-Line %s@%s (set by %s %d seconds ago)",(*i)->identmask,(*i)->hostmask,(*i)->source,(*i)->duration);
                klines.erase(i);
        }