summaryrefslogtreecommitdiff
path: root/src/commands.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-09 16:35:24 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-09 16:35:24 +0000
commit1cbf29e3cd070c12437a657b47fc433008b2c74d (patch)
tree22b7a435ffd8bfa7dd97f2457b73df564753eddc /src/commands.cpp
parent89749a74402913d50bd5a9140757a383d6ff175e (diff)
Move clientlist and chanlist into InspIRCd*
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4818 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/commands.cpp')
-rw-r--r--src/commands.cpp15
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);