From 1cbf29e3cd070c12437a657b47fc433008b2c74d Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 9 Aug 2006 16:35:24 +0000 Subject: Move clientlist and chanlist into InspIRCd* git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4818 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/commands.cpp') 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 all_opers; extern std::vector 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); -- cgit v1.2.3