diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-09 17:52:10 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-09 17:52:10 +0000 |
commit | 2591562ada4cb1f866e5d1c98340fb19332b3844 (patch) | |
tree | 1cf18676c1851c39322d20fa208c0221e23ba6ac /src/modules | |
parent | 1cbf29e3cd070c12437a657b47fc433008b2c74d (diff) |
Move tons more stuff into class InspIRCd
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4819 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_chanprotect.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_globops.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_helpop.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_override.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_park.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_redirect.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_safelist.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree.cpp | 24 | ||||
-rw-r--r-- | src/modules/m_spy.cpp | 2 |
9 files changed, 26 insertions, 21 deletions
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 3764b400e..53e725504 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -308,7 +308,7 @@ class ModuleChanProtect : public Module // the config option for it is set if (FirstInGetsFounder) { - if (Srv->CountUsers(channel) == 1) + if (channel->GetUserCounter() == 1) { // we're using Extensible::Extend to add data into user objects. // this way is best as it adds data thats accessible to other modules diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp index 2b2af1539..a02ad1172 100644 --- a/src/modules/m_globops.cpp +++ b/src/modules/m_globops.cpp @@ -28,6 +28,7 @@ using namespace std; /* $ModDesc: Provides support for GLOBOPS and user mode +g */ static Server *Srv; +extern InspIRCd* ServerInstance; class cmd_globops : public command_t { @@ -45,7 +46,7 @@ class cmd_globops : public command_t { line = line + std::string(parameters[i]) + " "; } - Srv->SendToModeMask("og",WM_AND,line); + ServerInstance->WriteMode("og",WM_AND,line.c_str()); } }; diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index 69f61ab1a..28e826276 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -26,6 +26,8 @@ using namespace std; static ConfigReader *helpop; static Server *Srv; +extern InspIRCd* ServerInstance; + bool do_helpop(const char**, int, userrec*); void sendtohelpop(userrec*, int, const char**); @@ -177,7 +179,7 @@ void sendtohelpop(userrec *src, int pcnt, const char **params) { line = line + std::string(params[i]) + " "; } - Srv->SendToModeMask("oh",WM_AND,line); + ServerInstance->WriteMode("oh",WM_AND,line.c_str()); } class HelpopException : public ModuleException diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index 9cb2e28ae..c16a2125f 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -225,7 +225,7 @@ class ModuleOverride : public Module return -1; } - if ((chan->limit > 0) && (Srv->CountUsers(chan) >= chan->limit) && (CanOverride(user,"LIMIT"))) + if ((chan->limit > 0) && (chan->GetUserCounter() >= chan->limit) && (CanOverride(user,"LIMIT"))) { if (NoisyOverride) chan->WriteChannelWithServ(Srv->GetServerName().c_str(), "NOTICE %s :%s passed through your channel limit", cname, user->nick); diff --git a/src/modules/m_park.cpp b/src/modules/m_park.cpp index e26af09f2..779a4e8a0 100644 --- a/src/modules/m_park.cpp +++ b/src/modules/m_park.cpp @@ -25,6 +25,8 @@ using namespace std; #include "modules.h" #include "inspircd.h" +extern InspIRCd* ServerInstance; + /* $ModDesc: Provides support for user parking/unparking */ class parking : public classbase @@ -88,7 +90,7 @@ class cmd_park : public command_t unsigned long* key = new unsigned long; *key = abs(random() * 12345); snprintf(msg,MAXBUF,"You are now parked. To unpark use /UNPARK %s %lu",user->nick, *key); - Srv->UserToPseudo(user,std::string(msg)); + ServerInstance->UserToPseudo(user,std::string(msg)); aw = new awaylog; user->Extend("park_awaylog", aw); user->Extend("park_key", key); @@ -174,7 +176,7 @@ class cmd_unpark : public command_t // remove all their old modes user->WriteServ("MODE %s -%s",user->nick,user->FormatModes()); // now, map them to the parked user, while nobody can see :p - Srv->PseudoToUser(user,unpark,"Unparked to "+std::string(parameters[0])); + ServerInstance->PseudoToUser(user,unpark,"Unparked to "+std::string(parameters[0])); // set all their new modes unpark->WriteServ("MODE %s +%s",unpark->nick,unpark->FormatModes()); // spool their away log to them diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp index ae45c67a3..d7f82f38e 100644 --- a/src/modules/m_redirect.cpp +++ b/src/modules/m_redirect.cpp @@ -135,7 +135,7 @@ class ModuleRedirect : public Module { if (chan->IsModeSet('L')) { - if (Srv->CountUsers(chan) >= chan->limit) + if (chan->GetUserCounter() >= chan->limit) { std::string channel = chan->GetModeParameter('L'); user->WriteServ("470 %s :%s has become full, so you are automatically being transferred to the linked channel %s",user->nick,cname,channel.c_str()); diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp index 38985dcb5..45177805e 100644 --- a/src/modules/m_safelist.cpp +++ b/src/modules/m_safelist.cpp @@ -102,7 +102,7 @@ class ListTimer : public InspTimer bool has_user = (chan && chan->HasUser(u)); if ((chan) && (((!(chan->modes[CM_PRIVATE])) && (!(chan->modes[CM_SECRET]))) || (has_user))) { - long users = usercount(chan); + long users = chan->GetUserCounter(); if (users) { int counter = snprintf(buffer,MAXBUF,"322 %s %s %ld :[+%s] %s",u->nick,chan->name,users,chanmodes(chan,has_user),chan->topic); diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index d0d7389de..3206c5621 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -3483,23 +3483,23 @@ class ModuleSpanningTree : public Module void HandleLusers(const char** parameters, int pcnt, userrec* user) { - unsigned int n_users = usercnt(); + unsigned int n_users = ServerInstance->usercnt(); /* Only update these when someone wants to see them, more efficient */ - if ((unsigned int)local_count() > max_local) - max_local = local_count(); + if ((unsigned int)ServerInstance->local_count() > max_local) + max_local = ServerInstance->local_count(); if (n_users > max_global) max_global = n_users; - user->WriteServ("251 %s :There are %d users and %d invisible on %d servers",user->nick,n_users-usercount_invisible(),usercount_invisible(),this->CountServs()); - if (usercount_opers()) - user->WriteServ("252 %s %d :operator(s) online",user->nick,usercount_opers()); - if (usercount_unknown()) - user->WriteServ("253 %s %d :unknown connections",user->nick,usercount_unknown()); - if (chancount()) - user->WriteServ("254 %s %d :channels formed",user->nick,chancount()); - user->WriteServ("254 %s :I have %d clients and %d servers",user->nick,local_count(),this->CountLocalServs()); - user->WriteServ("265 %s :Current Local Users: %d Max: %d",user->nick,local_count(),max_local); + user->WriteServ("251 %s :There are %d users and %d invisible on %d servers",user->nick,n_users-ServerInstance->usercount_invisible(),ServerInstance->usercount_invisible(),this->CountServs()); + if (ServerInstance->usercount_opers()) + user->WriteServ("252 %s %d :operator(s) online",user->nick,ServerInstance->usercount_opers()); + if (ServerInstance->usercount_unknown()) + user->WriteServ("253 %s %d :unknown connections",user->nick,ServerInstance->usercount_unknown()); + if (ServerInstance->chancount()) + user->WriteServ("254 %s %d :channels formed",user->nick,ServerInstance->chancount()); + user->WriteServ("254 %s :I have %d clients and %d servers",user->nick,ServerInstance->local_count(),this->CountLocalServs()); + user->WriteServ("265 %s :Current Local Users: %d Max: %d",user->nick,ServerInstance->local_count(),max_local); user->WriteServ("266 %s :Current Global Users: %d Max: %d",user->nick,n_users,max_global); return; } diff --git a/src/modules/m_spy.cpp b/src/modules/m_spy.cpp index faf4e431a..40be036ab 100644 --- a/src/modules/m_spy.cpp +++ b/src/modules/m_spy.cpp @@ -98,7 +98,7 @@ class cmd_spylist : public command_t user->WriteServ("321 %s Channel :Users Name",user->nick); for (chan_hash::const_iterator i = chanlist.begin(); i != chanlist.end(); i++) { - user->WriteServ("322 %s %s %d :[+%s] %s",user->nick,i->second->name,usercount(i->second),chanmodes(i->second,true),i->second->topic); + user->WriteServ("322 %s %s %d :[+%s] %s",user->nick,i->second->name,i->second->GetUserCounter(),chanmodes(i->second,true),i->second->topic); } user->WriteServ("323 %s :End of channel list.",user->nick); } |