]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Change to use std::string::iterator rather than making a copy of the pointer and...
[user/henk/code/inspircd.git] / src / command_parse.cpp
index cb43df1a1bb15eb25896b061b450d6b03139cfbe..f842ee49e1f81f7bccfacddb5c7d680564b3465f 100644 (file)
@@ -106,89 +106,6 @@ long InspIRCd::Duration(const char* str)
        return total;
 }
 
-/* All other ircds when doing this check usually just look for a string of *@* or *. We're smarter than that, though. */
-
-bool InspIRCd::HostMatchesEveryone(const std::string &mask, userrec* user)
-{
-       char buffer[MAXBUF];
-       char itrigger[MAXBUF];
-       long matches = 0;
-       
-       if (!Config->ConfValue(Config->config_data, "insane","trigger", 0, itrigger, MAXBUF))
-               strlcpy(itrigger,"95.5",MAXBUF);
-       
-       if (Config->ConfValueBool(Config->config_data, "insane","hostmasks", 0))
-               return false;
-       
-       for (user_hash::iterator u = clientlist.begin(); u != clientlist.end(); u++)
-       {
-               strlcpy(buffer,u->second->ident,MAXBUF);
-               charlcat(buffer,'@',MAXBUF);
-               strlcat(buffer,u->second->host,MAXBUF);
-               if (match(buffer,mask.c_str()))
-                       matches++;
-       }
-       float percent = ((float)matches / (float)clientlist.size()) * 100;
-       if (percent > (float)atof(itrigger))
-       {
-               WriteOpers("*** \2WARNING\2: %s tried to set a G/K/E line mask of %s, which covers %.2f%% of the network!",user->nick,mask.c_str(),percent);
-               return true;
-       }
-       return false;
-}
-
-bool InspIRCd::IPMatchesEveryone(const std::string &ip, userrec* user)
-{
-       char itrigger[MAXBUF];
-       long matches = 0;
-       
-       if (!Config->ConfValue(Config->config_data, "insane","trigger",0,itrigger,MAXBUF))
-               strlcpy(itrigger,"95.5",MAXBUF);
-       
-       if (Config->ConfValueBool(Config->config_data, "insane","ipmasks",0))
-               return false;
-       
-       for (user_hash::iterator u = clientlist.begin(); u != clientlist.end(); u++)
-       {
-               if (match(u->second->GetIPString(),ip.c_str(),true))
-                       matches++;
-       }
-       
-       float percent = ((float)matches / (float)clientlist.size()) * 100;
-       if (percent > (float)atof(itrigger))
-       {
-               WriteOpers("*** \2WARNING\2: %s tried to set a Z line mask of %s, which covers %.2f%% of the network!",user->nick,ip.c_str(),percent);
-               return true;
-       }
-       return false;
-}
-
-bool InspIRCd::NickMatchesEveryone(const std::string &nick, userrec* user)
-{
-       char itrigger[MAXBUF];
-       long matches = 0;
-       
-       if (!Config->ConfValue(Config->config_data, "insane","trigger",0,itrigger,MAXBUF))
-               strlcpy(itrigger,"95.5",MAXBUF);
-       
-       if (Config->ConfValueBool(Config->config_data, "insane","nickmasks",0))
-               return false;
-
-       for (user_hash::iterator u = clientlist.begin(); u != clientlist.end(); u++)
-       {
-               if (match(u->second->nick,nick.c_str()))
-                       matches++;
-       }
-       
-       float percent = ((float)matches / (float)clientlist.size()) * 100;
-       if (percent > (float)atof(itrigger))
-       {
-               WriteOpers("*** \2WARNING\2: %s tried to set a Q line mask of %s, which covers %.2f%% of the network!",user->nick,nick.c_str(),percent);
-               return true;
-       }
-       return false;
-}
-
 /* LoopCall is used to call a command classes handler repeatedly based on the contents of a comma seperated list.
  * There are two overriden versions of this method, one of which takes two potential lists and the other takes one.
  * We need a version which takes two potential lists for JOIN, because a JOIN may contain two lists of items at once,
@@ -505,7 +422,7 @@ bool CommandParser::CreateCommand(command_t *f, void* so_handle)
                if (RFCCommands.find(f->command) == RFCCommands.end())
                {
                        RFCCommands[f->command] = so_handle;
-                       ServerInstance->Log(DEFAULT,"Monitoring RFC-specified reloadable command at %8x",so_handle);
+                       ServerInstance->Log(DEBUG,"Monitoring RFC-specified reloadable command at %8x",so_handle);
                }
                else
                {
@@ -518,7 +435,7 @@ bool CommandParser::CreateCommand(command_t *f, void* so_handle)
        if (cmdlist.find(f->command) == cmdlist.end())
        {
                cmdlist[f->command] = f;
-               ServerInstance->Log(DEBUG,"Added command %s (%lu parameters)",f->command.c_str(),(unsigned long)f->min_params);
+               ServerInstance->Log(DEBUG,"Added command %s (%d parameters)", f->command.c_str(), f->min_params);
                return true;
        }
        else return false;