X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommand_parse.cpp;h=07b41c4cba644b4ead2fba50b4c4992f479c1fbd;hb=74c8913f72e6d48c88a01155ef5fe5ca20cc2bb1;hp=3ce91afda59f37b402435085e6f22cb7163420a4;hpb=3712db9cc6365e556a803daf32416ae929e95330;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 3ce91afda..07b41c4cb 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -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, @@ -475,7 +392,6 @@ void CommandParser::RemoveCommand(nspace::hash_map::iter command_t* x = safei->second; if (x->source == std::string(source)) { - ServerInstance->Log(DEBUG,"removecommands(%s) Removing dependent command: %s",x->source.c_str(),x->command.c_str()); cmdlist.erase(safei); } }