diff options
Diffstat (limited to 'src/commands.cpp')
-rw-r--r-- | src/commands.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/commands.cpp b/src/commands.cpp index 9a6be7206..8504c174d 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -63,9 +63,6 @@ const long duration_d = duration_h * 24; const long duration_w = duration_d * 7; const long duration_y = duration_w * 52; -extern user_hash clientlist; -extern chan_hash chanlist; - extern std::vector<userrec*> all_opers; extern std::vector<userrec*> local_users; @@ -202,7 +199,7 @@ bool host_matches_everyone(const std::string &mask, userrec* user) if (ServerInstance->Config->ConfValueBool(ServerInstance->Config->config_data, "insane","hostmasks", 0)) return false; - for (user_hash::iterator u = clientlist.begin(); u != clientlist.end(); u++) + for (user_hash::iterator u = ServerInstance->clientlist.begin(); u != ServerInstance->clientlist.end(); u++) { strlcpy(buffer,u->second->ident,MAXBUF); charlcat(buffer,'@',MAXBUF); @@ -210,7 +207,7 @@ bool host_matches_everyone(const std::string &mask, userrec* user) if (match(buffer,mask.c_str())) matches++; } - float percent = ((float)matches / (float)clientlist.size()) * 100; + float percent = ((float)matches / (float)ServerInstance->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); @@ -230,13 +227,13 @@ bool ip_matches_everyone(const std::string &ip, userrec* user) if (ServerInstance->Config->ConfValueBool(ServerInstance->Config->config_data, "insane","ipmasks",0)) return false; - for (user_hash::iterator u = clientlist.begin(); u != clientlist.end(); u++) + for (user_hash::iterator u = ServerInstance->clientlist.begin(); u != ServerInstance->clientlist.end(); u++) { if (match(u->second->GetIPString(),ip.c_str(),true)) matches++; } - float percent = ((float)matches / (float)clientlist.size()) * 100; + float percent = ((float)matches / (float)ServerInstance->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); @@ -256,13 +253,13 @@ bool nick_matches_everyone(const std::string &nick, userrec* user) if (ServerInstance->Config->ConfValueBool(ServerInstance->Config->config_data, "insane","nickmasks",0)) return false; - for (user_hash::iterator u = clientlist.begin(); u != clientlist.end(); u++) + for (user_hash::iterator u = ServerInstance->clientlist.begin(); u != ServerInstance->clientlist.end(); u++) { if (match(u->second->nick,nick.c_str())) matches++; } - float percent = ((float)matches / (float)clientlist.size()) * 100; + float percent = ((float)matches / (float)ServerInstance->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); |