diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-10 23:53:48 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-10 23:53:48 +0000 |
commit | d0b4bb3811458aa335857514e4cbb95d5c84f433 (patch) | |
tree | e3a88027d3ef17a26a6d1535213244536ca4dcbd | |
parent | 55e2180b4a5fb65faac05ce4956ab1e5515fa9e5 (diff) |
Last of Server:: methods moved to InspIRCd::. Server:: removed.
This will need a real good tidyup later, because now everything is in the right place, but its a mess because for now i threw them into place (e.g. space indenting, etc)
Next on the todo: Make command handlers have a ServerInstance (gank!)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4861 e03df62e-2008-0410-955e-edbf42e46eb7
83 files changed, 239 insertions, 250 deletions
diff --git a/src/modules/m_antibottler.cpp b/src/modules/m_antibottler.cpp index a8d492f90..9c7d75ea2 100644 --- a/src/modules/m_antibottler.cpp +++ b/src/modules/m_antibottler.cpp @@ -23,9 +23,6 @@ using namespace std; class ModuleAntiBottler : public Module { - private: - - Server *Srv; public: ModuleAntiBottler(InspIRCd* Me) : Module::Module(Me) diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp index 2c9bdee79..4d817f43b 100644 --- a/src/modules/m_banexception.cpp +++ b/src/modules/m_banexception.cpp @@ -30,14 +30,14 @@ class BanException : public ListModeBase class ModuleBanException : public Module { BanException* be; - Server* Srv; + public: ModuleBanException(InspIRCd* Me) : Module::Module(Me) { be = new BanException(ServerInstance); - Srv->AddMode(be, 'e'); + ServerInstance->AddMode(be, 'e'); } virtual void Implements(char* List) @@ -62,7 +62,7 @@ public: if(list) { for (modelist::iterator it = list->begin(); it != list->end(); it++) - if(Srv->MatchText(user->GetFullRealHost(), it->mask) || Srv->MatchText(user->GetFullHost(), it->mask)) + if(ServerInstance->MatchText(user->GetFullRealHost(), it->mask) || ServerInstance->MatchText(user->GetFullHost(), it->mask)) // They match an entry on the list, so let them in. return 1; return 0; diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp index 62d744f9a..78b7d278f 100644 --- a/src/modules/m_blockamsg.cpp +++ b/src/modules/m_blockamsg.cpp @@ -48,7 +48,7 @@ public: class ModuleBlockAmsg : public Module { - Server* Srv; + int ForgetDelay; BlockAction action; public: diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp index c23fbe741..d023bc733 100644 --- a/src/modules/m_blockcaps.cpp +++ b/src/modules/m_blockcaps.cpp @@ -56,7 +56,7 @@ class BlockCaps : public ModeHandler class ModuleBlockCAPS : public Module { - Server *Srv; + BlockCaps* bc; public: @@ -64,7 +64,7 @@ public: { bc = new BlockCaps(ServerInstance); - Srv->AddMode(bc, 'P'); + ServerInstance->AddMode(bc, 'P'); } void Implements(char* List) diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index f872abcb8..92919d153 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -58,7 +58,7 @@ class BlockColor : public ModeHandler class ModuleBlockColour : public Module { - Server *Srv; + BlockColor *bc; public: @@ -66,7 +66,7 @@ class ModuleBlockColour : public Module { bc = new BlockColor(ServerInstance); - Srv->AddMode(bc, 'c'); + ServerInstance->AddMode(bc, 'c'); } void Implements(char* List) diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index 57ece4759..a2c866b7c 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -63,7 +63,7 @@ class BotMode : public ModeHandler class ModuleBotMode : public Module { - Server *Srv; + BotMode* bm; public: ModuleBotMode(InspIRCd* Me) @@ -71,7 +71,7 @@ class ModuleBotMode : public Module { bm = new BotMode(ServerInstance); - Srv->AddMode(bm, 'B'); + ServerInstance->AddMode(bm, 'B'); } void Implements(char* List) diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 6e4d83fcf..217db32c8 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -132,14 +132,14 @@ class cmd_cban : public command_t class ModuleCBan : public Module { cmd_cban* mycommand; - Server* Srv; + public: ModuleCBan(InspIRCd* Me) : Module::Module(Me) { mycommand = new cmd_cban(Me); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } void Implements(char* List) diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp index 8ed3d47f3..60cc6dc39 100644 --- a/src/modules/m_censor.cpp +++ b/src/modules/m_censor.cpp @@ -102,7 +102,7 @@ class CensorChannel : public ModeHandler class ModuleCensor : public Module { - Server *Srv; + censor_t censors; CensorUser *cu; CensorChannel *cc; @@ -127,8 +127,8 @@ class ModuleCensor : public Module OnRehash(""); cu = new CensorUser(ServerInstance); cc = new CensorChannel(ServerInstance); - Srv->AddMode(cu, 'G'); - Srv->AddMode(cc, 'G'); + ServerInstance->AddMode(cu, 'G'); + ServerInstance->AddMode(cc, 'G'); } void Implements(char* List) diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 01a04d28f..36a432cfe 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -87,7 +87,7 @@ class CGIResolver : public Resolver class ModuleCgiIRC : public Module { - Server *Srv; + bool NotifyOpers; CGIHostlist Hosts; public: @@ -203,7 +203,7 @@ public: { log(DEBUG, "m_cgiirc.so: Matching %s against (%s or %s)", iter->hostmask.c_str(), user->host, user->GetIPString()); - if(Srv->MatchText(user->host, iter->hostmask) || Srv->MatchText(user->GetIPString(), iter->hostmask)) + if(ServerInstance->MatchText(user->host, iter->hostmask) || ServerInstance->MatchText(user->GetIPString(), iter->hostmask)) { // Deal with it... log(DEBUG, "m_cgiirc.so: Handling CGI:IRC user: %s (%s) matched %s", user->GetFullRealHost(), user->GetIPString(), iter->hostmask.c_str()); @@ -263,7 +263,7 @@ public: try { CGIResolver* r = new CGIResolver(NotifyOpers, user->password, false, user, user->fd, "PASS"); - Srv->AddResolver(r); + ServerInstance->AddResolver(r); } catch (ModuleException& e) { @@ -319,7 +319,7 @@ public: { log(DEBUG,"MAKE RESOLVER: %s %d %s",newip, user->fd, "IDENT"); CGIResolver* r = new CGIResolver(NotifyOpers, newip, false, user, user->fd, "IDENT"); - Srv->AddResolver(r); + ServerInstance->AddResolver(r); } catch (ModuleException& e) { diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index 277167e90..73c9d4f47 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -66,7 +66,7 @@ class ChanFilter : public ListModeBase class ModuleChanFilter : public Module { - Server *Srv; + ChanFilter* cf; public: @@ -75,7 +75,7 @@ class ModuleChanFilter : public Module : Module::Module(Me) { cf = new ChanFilter(ServerInstance); - Srv->AddMode(cf, 'g'); + ServerInstance->AddMode(cf, 'g'); } void Implements(char* List) diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index fcb401868..dbf2f6e7d 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -244,7 +244,7 @@ class ChanProtect : public ModeHandler class ModuleChanProtect : public Module { - Server *Srv; + bool FirstInGetsFounder; ChanProtect* cp; ChanFounder* cf; @@ -259,8 +259,8 @@ class ModuleChanProtect : public Module cp = new ChanProtect(ServerInstance); cf = new ChanFounder(ServerInstance); - Srv->AddMode(cp, 'a'); - Srv->AddMode(cf, 'q'); + ServerInstance->AddMode(cp, 'a'); + ServerInstance->AddMode(cf, 'q'); /* Load config stuff */ OnRehash(""); @@ -343,7 +343,7 @@ class ModuleChanProtect : public Module // firstly, if a ulined nick, or a server, is setting the mode, then allow them to set the mode // without any access checks, we're not worthy :p - if ((Srv->IsUlined(source->nick)) || (Srv->IsUlined(source->server)) || (!strcmp(source->server,""))) + if ((ServerInstance->IsUlined(source->nick)) || (ServerInstance->IsUlined(source->server)) || (!strcmp(source->server,""))) { return ACR_ALLOW; } diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 251faf58a..692a7113a 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -28,8 +28,6 @@ using namespace std; extern InspIRCd* ServerInstance; -static Server *Srv; - class cmd_check : public command_t { public: @@ -91,7 +89,7 @@ class cmd_check : public command_t chliststr = targuser->ChannelList(targuser); std::stringstream dump(chliststr); - Srv->DumpText(user,checkstr + " onchans ", dump); + ServerInstance->DumpText(user,checkstr + " onchans ", dump); } else if (targchan) { @@ -192,7 +190,7 @@ class ModuleCheck : public Module { mycommand = new cmd_check(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleCheck() diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index be5730e11..d4e7edb51 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -26,7 +26,6 @@ using namespace std; /* $ModDesc: Provides support for the CHGHOST command */ -static Server *Srv; extern InspIRCd* ServerInstance; class cmd_chghost : public command_t @@ -61,7 +60,7 @@ class cmd_chghost : public command_t userrec* dest = ServerInstance->FindNick(parameters[0]); if (dest) { - if ((dest->ChangeDisplayedHost(parameters[1])) && (!Srv->IsUlined(user->server))) + if ((dest->ChangeDisplayedHost(parameters[1])) && (!ServerInstance->IsUlined(user->server))) { // fix by brain - ulines set hosts silently ServerInstance->WriteOpers(std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+parameters[1]); @@ -80,7 +79,7 @@ class ModuleChgHost : public Module { mycommand = new cmd_chghost(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } void Implements(char* List) diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 83e3c70d5..039eb1022 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -43,13 +43,13 @@ class cmd_chgident : public command_t class ModuleChgIdent : public Module { cmd_chgident* mycommand; - Server* Srv; + public: ModuleChgIdent(InspIRCd* Me) : Module::Module(Me) { mycommand = new cmd_chgident(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleChgIdent() diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 692b55b65..91a6bc31b 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -70,7 +70,7 @@ class xMD5Context : public classbase class CloakUser : public ModeHandler { - Server* Srv; + std::string prefix; word32 key1; word32 key2; @@ -398,7 +398,7 @@ class CloakUser : public ModeHandler class ModuleCloaking : public Module { private: - Server *Srv; + CloakUser* cu; public: @@ -409,7 +409,7 @@ class ModuleCloaking : public Module cu = new CloakUser(ServerInstance); /* Register it with the core */ - Srv->AddMode(cu, 'x'); + ServerInstance->AddMode(cu, 'x'); OnRehash(""); } @@ -447,7 +447,7 @@ class ModuleCloaking : public Module const char* modes[2]; // only two parameters modes[0] = user->nick; // first parameter is the nick modes[1] = "+x"; // second parameter is the mode - Srv->SendMode(modes,2,user); // send these, forming the command "MODE <nick> +x" + ServerInstance->SendMode(modes,2,user); // send these, forming the command "MODE <nick> +x" } }; diff --git a/src/modules/m_conn_lusers.cpp b/src/modules/m_conn_lusers.cpp index c0be6123b..2d6481941 100644 --- a/src/modules/m_conn_lusers.cpp +++ b/src/modules/m_conn_lusers.cpp @@ -33,7 +33,7 @@ class ModuleConnLUSERS : public Module { private: - Server *Srv; + public: ModuleConnLUSERS(InspIRCd* Me) : Module::Module(Me) @@ -70,7 +70,7 @@ class ModuleConnLUSERS : public Module } else { - Srv->CallCommandHandler("LUSERS", NULL, 0, user); + ServerInstance->CallCommandHandler("LUSERS", NULL, 0, user); } } }; diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp index 5686f6810..43d0f2216 100644 --- a/src/modules/m_conn_waitpong.cpp +++ b/src/modules/m_conn_waitpong.cpp @@ -31,7 +31,7 @@ char* RandString(unsigned int length) class ModuleWaitPong : public Module { - Server* Srv; + ConfigReader* Conf; bool sendsnotice; diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp index d6a23344e..a7a7d33b6 100644 --- a/src/modules/m_connflood.cpp +++ b/src/modules/m_connflood.cpp @@ -38,7 +38,7 @@ private: std::string quitmsg; ConfigReader* conf; - Server *Srv; + public: ModuleConnFlood(InspIRCd* Me) : Module::Module(Me) diff --git a/src/modules/m_denychans.cpp b/src/modules/m_denychans.cpp index 7a05c0513..c823b9c1e 100644 --- a/src/modules/m_denychans.cpp +++ b/src/modules/m_denychans.cpp @@ -27,7 +27,7 @@ class ModuleDenyChannels : public Module { private: - Server *Srv; + ConfigReader *Conf; public: diff --git a/src/modules/m_devoice.cpp b/src/modules/m_devoice.cpp index b2c411e74..5b60752f3 100644 --- a/src/modules/m_devoice.cpp +++ b/src/modules/m_devoice.cpp @@ -27,8 +27,9 @@ using namespace std; #include "users.h" #include "channels.h" #include "modules.h" +#include "inspircd.h" -static Server *Srv; +extern InspIRCd* ServerInstance; class cmd_devoice : public command_t { @@ -52,7 +53,7 @@ class cmd_devoice : public command_t modes[1] = "-v"; modes[2] = user->nick; - Srv->SendMode(modes,3,user); + ServerInstance->SendMode(modes,3,user); } }; @@ -64,7 +65,7 @@ class ModuleDeVoice : public Module { mycommand = new cmd_devoice(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleDeVoice() diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index a20cf6bf2..a0c2a97c2 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -52,7 +52,7 @@ class FilterException : public ModuleException class ModuleFilter : public Module { - Server *Srv; + filter_t filters; public: @@ -89,7 +89,7 @@ class ModuleFilter : public Module std::string text2 = text+" "; for (filter_t::iterator index = filters.begin(); index != filters.end(); index++) { - if ((Srv->MatchText(text2,index->first)) || (Srv->MatchText(text,index->first))) + if ((ServerInstance->MatchText(text2,index->first)) || (ServerInstance->MatchText(text,index->first))) { Filter* f = (Filter*)index->second; std::string target = ""; diff --git a/src/modules/m_foobar.cpp b/src/modules/m_foobar.cpp index cca4a6cbc..b6b6eae10 100644 --- a/src/modules/m_foobar.cpp +++ b/src/modules/m_foobar.cpp @@ -36,7 +36,7 @@ class ModuleFoobar : public Module // encapsulate the exports from the core of the ircd. // such methods include Debug, SendChannel, etc. - Server *Srv; + public: ModuleFoobar(InspIRCd* Me) : Module::Module(Me) diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index ef3c1cb5d..c552cb346 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -77,15 +77,15 @@ class ModuleGlobalLoad : public Module { cmd_gloadmodule *mycommand; cmd_gunloadmodule *mycommand2; - Server *Srv; + public: ModuleGlobalLoad(InspIRCd* Me) : Module::Module(Me) { mycommand = new cmd_gloadmodule(); mycommand2 = new cmd_gunloadmodule(); - Srv->AddCommand(mycommand); - Srv->AddCommand(mycommand2); + ServerInstance->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand2); } virtual ~ModuleGlobalLoad() diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp index f744895ec..d86b8ab13 100644 --- a/src/modules/m_globops.cpp +++ b/src/modules/m_globops.cpp @@ -27,7 +27,6 @@ using namespace std; /* $ModDesc: Provides support for GLOBOPS and user mode +g */ -static Server *Srv; extern InspIRCd* ServerInstance; class cmd_globops : public command_t @@ -89,9 +88,9 @@ class ModuleGlobops : public Module { mg = new ModeGlobops(ServerInstance); - Srv->AddMode(mg, 'g'); + ServerInstance->AddMode(mg, 'g'); mycommand = new cmd_globops(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleGlobops() diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index accec7a2d..fa3f4eed9 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -24,7 +24,6 @@ using namespace std; // Global Vars static ConfigReader *helpop; -static Server *Srv; extern InspIRCd* ServerInstance; @@ -206,9 +205,9 @@ class ModuleHelpop : public Module { ReadConfig(); ho = new Helpop(ServerInstance); - Srv->AddMode(ho, 'h'); + ServerInstance->AddMode(ho, 'h'); mycommand = new cmd_helpop(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual void ReadConfig() diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp index 512af06cd..1a5986fc2 100644 --- a/src/modules/m_hostchange.cpp +++ b/src/modules/m_hostchange.cpp @@ -39,7 +39,7 @@ class ModuleHostChange : public Module { private: - Server *Srv; + ConfigReader *Conf; hostchanges_t hostchanges; std::string MySuffix; @@ -101,7 +101,7 @@ class ModuleHostChange : public Module { for (hostchanges_t::iterator i = hostchanges.begin(); i != hostchanges.end(); i++) { - if (Srv->MatchText(std::string(user->ident)+"@"+std::string(user->host),i->first)) + if (ServerInstance->MatchText(std::string(user->ident)+"@"+std::string(user->host),i->first)) { Host* h = (Host*)i->second; // host of new user matches a hostchange tag's mask diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index ae3611024..4699d0696 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -31,7 +31,6 @@ class ModuleHttp; extern InspIRCd* ServerInstance; -static Server *Srv; static ModuleHttp* HttpModule; extern time_t TIME; static bool claimed; @@ -67,7 +66,7 @@ class HttpSocket : public InspSocket if (InternalState == HTTP_LISTEN) { HttpSocket* s = new HttpSocket(this->Instance, newsock, ip, index); - Srv->AddSocket(s); + ServerInstance->AddSocket(s); } return true; } @@ -281,7 +280,7 @@ class ModuleHttp : public Module http = new HttpSocket(ServerInstance, this->bindip, this->port, true, 0, &index); if ((http) && (http->GetState() == I_LISTENING)) { - Srv->AddSocket(http); + ServerInstance->AddSocket(http); } } @@ -313,7 +312,7 @@ class ModuleHttp : public Module virtual ~ModuleHttp() { - Srv->DelSocket(http); + ServerInstance->DelSocket(http); } virtual Version GetVersion() diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 95b8b73ed..5fd161e2e 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -41,7 +41,7 @@ static SortedList* so = new SortedList(); class ModuleHttpStats : public Module { - Server* Srv; + std::string stylesheet; bool changed; diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 781661c48..df6078c1d 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -34,7 +34,7 @@ extern userrec* fd_ref_table[MAX_DESCRIPTORS]; class RFC1413 : public InspSocket { protected: - Server* Srv; // Server* class used for core communications + // Server* class used for core communications insp_sockaddr sock_us; // our port number insp_sockaddr sock_them; // their port number socklen_t uslen; // length of our port number @@ -45,7 +45,7 @@ class RFC1413 : public InspSocket userrec* u; // user record that the lookup is associated with int ufd; - RFC1413(InspIRCd* SI, userrec* user, int maxtime, Server* S) : InspSocket(SI, user->GetIPString(), 113, false, maxtime), Srv(S), u(user), ufd(user->fd) + RFC1413(InspIRCd* SI, userrec* user, int maxtime) : InspSocket(SI, user->GetIPString(), 113, false, maxtime), u(user), ufd(user->fd) { log(DEBUG,"Ident: associated."); } @@ -175,7 +175,7 @@ class ModuleIdent : public Module { ConfigReader* Conf; - Server* Srv; + int IdentTimeout; public: @@ -214,11 +214,11 @@ class ModuleIdent : public Module * Server::AddSocket() call. */ user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Looking up your ident..."); - RFC1413* ident = new RFC1413(ServerInstance, user, IdentTimeout, Srv); + RFC1413* ident = new RFC1413(ServerInstance, user, IdentTimeout); if (ident->GetState() != I_ERROR) { user->Extend("ident_data", (char*)ident); - Srv->AddSocket(ident); + ServerInstance->AddSocket(ident); } else { @@ -251,7 +251,7 @@ class ModuleIdent : public Module // a user which has now vanished! To prevent this, set ident::u // to NULL and check it so that we dont write users who have gone away. ident->u = NULL; - Srv->RemoveSocket(ident); + ServerInstance->RemoveSocket(ident); } } } @@ -270,7 +270,7 @@ class ModuleIdent : public Module if (user->GetExt("ident_data", ident)) { ident->u = NULL; - Srv->RemoveSocket(ident); + ServerInstance->RemoveSocket(ident); } } diff --git a/src/modules/m_inviteexception.cpp b/src/modules/m_inviteexception.cpp index 51a489de0..f9f3c63af 100644 --- a/src/modules/m_inviteexception.cpp +++ b/src/modules/m_inviteexception.cpp @@ -30,13 +30,13 @@ class InviteException : public ListModeBase class ModuleInviteException : public Module { InviteException* ie; - Server* Srv; + public: ModuleInviteException(InspIRCd* Me) : Module(Me) { ie = new InviteException(ServerInstance); - Srv->AddMode(ie, 'I'); + ServerInstance->AddMode(ie, 'I'); } virtual void Implements(char* List) diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp index 7603e36d5..6246ea269 100644 --- a/src/modules/m_joinflood.cpp +++ b/src/modules/m_joinflood.cpp @@ -188,7 +188,7 @@ class JoinFlood : public ModeHandler class ModuleJoinFlood : public Module { - Server *Srv; + JoinFlood* jf; public: @@ -198,7 +198,7 @@ class ModuleJoinFlood : public Module { jf = new JoinFlood(ServerInstance); - Srv->AddMode(jf, 'j'); + ServerInstance->AddMode(jf, 'j'); } virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp index a9dc54a3e..65a8c4dac 100644 --- a/src/modules/m_kicknorejoin.cpp +++ b/src/modules/m_kicknorejoin.cpp @@ -70,7 +70,7 @@ class KickRejoin : public ModeHandler class ModuleKickNoRejoin : public Module { - Server *Srv; + KickRejoin* kr; public: @@ -80,7 +80,7 @@ public: { kr = new KickRejoin(ServerInstance); - Srv->AddMode(kr, 'J'); + ServerInstance->AddMode(kr, 'J'); } virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 7d0f8ea4c..f79520df7 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -27,7 +27,6 @@ using namespace std; /* $ModDesc: Provides support for /KNOCK and mode +K */ -static Server *Srv; extern InspIRCd* ServerInstance; class cmd_knock : public command_t @@ -114,9 +113,9 @@ class ModuleKnock : public Module { kn = new Knock(ServerInstance); - Srv->AddMode(kn, 'K'); + ServerInstance->AddMode(kn, 'K'); mycommand = new cmd_knock(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } void Implements(char* List) diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 79ab10eef..145bc51a2 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -186,7 +186,7 @@ class MsgFlood : public ModeHandler class ModuleMsgFlood : public Module { - Server *Srv; + MsgFlood* mf; public: @@ -196,7 +196,7 @@ class ModuleMsgFlood : public Module { mf = new MsgFlood(ServerInstance); - Srv->AddMode(mf, 'f'); + ServerInstance->AddMode(mf, 'f'); } void ProcessMessages(userrec* user,chanrec* dest, const std::string &text) @@ -217,7 +217,7 @@ class ModuleMsgFlood : public Module parameters[0] = dest->name; parameters[1] = "+b"; parameters[2] = user->MakeWildHost(); - Srv->SendMode(parameters,3,user); + ServerInstance->SendMode(parameters,3,user); std::deque<std::string> n; /* Propogate the ban to other servers. * We dont know what protocol we may be using, diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index 8710a2e6d..2f80e0d51 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -27,7 +27,6 @@ using namespace std; /* $ModDesc: Provides the NICKLOCK command, allows an oper to chage a users nick and lock them to it until they quit */ -static Server *Srv; extern InspIRCd* ServerInstance; class cmd_nicklock : public command_t @@ -102,8 +101,8 @@ class ModuleNickLock : public Module cmd1 = new cmd_nicklock(); cmd2 = new cmd_nickunlock(); - Srv->AddCommand(cmd1); - Srv->AddCommand(cmd2); + ServerInstance->AddCommand(cmd1); + ServerInstance->AddCommand(cmd2); } virtual ~ModuleNickLock() diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index 0c3e3649a..273c6c93e 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -57,7 +57,7 @@ class NoCTCP : public ModeHandler class ModuleNoCTCP : public Module { - Server *Srv; + NoCTCP* nc; public: @@ -67,7 +67,7 @@ class ModuleNoCTCP : public Module { nc = new NoCTCP(ServerInstance); - Srv->AddMode(nc, 'C'); + ServerInstance->AddMode(nc, 'C'); } void Implements(char* List) diff --git a/src/modules/m_noinvite.cpp b/src/modules/m_noinvite.cpp index ea4b246d7..cb1597527 100644 --- a/src/modules/m_noinvite.cpp +++ b/src/modules/m_noinvite.cpp @@ -57,7 +57,7 @@ class NoInvite : public ModeHandler class ModuleNoInvite : public Module { - Server *Srv; + NoInvite *ni; public: @@ -66,7 +66,7 @@ class ModuleNoInvite : public Module { ni = new NoInvite(ServerInstance); - Srv->AddMode(ni, 'V'); + ServerInstance->AddMode(ni, 'V'); } void Implements(char* List) diff --git a/src/modules/m_nokicks.cpp b/src/modules/m_nokicks.cpp index e58366fbf..0d7ad81da 100644 --- a/src/modules/m_nokicks.cpp +++ b/src/modules/m_nokicks.cpp @@ -57,7 +57,7 @@ class NoKicks : public ModeHandler class ModuleNoKicks : public Module { - Server *Srv; + NoKicks* nk; public: @@ -67,7 +67,7 @@ class ModuleNoKicks : public Module { nk = new NoKicks(ServerInstance); - Srv->AddMode(nk, 'Q'); + ServerInstance->AddMode(nk, 'Q'); } void Implements(char* List) @@ -86,7 +86,7 @@ class ModuleNoKicks : public Module { if (channel->IsModeSet('Q')) { - if ((Srv->IsUlined(source->nick)) || (Srv->IsUlined(source->server)) || (!strcmp(source->server,""))) + if ((ServerInstance->IsUlined(source->nick)) || (ServerInstance->IsUlined(source->server)) || (!strcmp(source->server,""))) { // ulines can still kick with +Q in place return ACR_ALLOW; diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp index daaf25ece..2ca3338f2 100644 --- a/src/modules/m_nonicks.cpp +++ b/src/modules/m_nonicks.cpp @@ -60,7 +60,7 @@ class NoNicks : public ModeHandler class ModuleNoNickChange : public Module { - Server *Srv; + NoNicks* nn; public: @@ -69,7 +69,7 @@ class ModuleNoNickChange : public Module { nn = new NoNicks(ServerInstance); - Srv->AddMode(nn, 'N'); + ServerInstance->AddMode(nn, 'N'); } virtual ~ModuleNoNickChange() diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp index 7ce1967fe..8c5e24248 100644 --- a/src/modules/m_nonotice.cpp +++ b/src/modules/m_nonotice.cpp @@ -57,7 +57,7 @@ class NoNotice : public ModeHandler class ModuleNoNotice : public Module { - Server *Srv; + NoNotice* nt; public: @@ -66,7 +66,7 @@ class ModuleNoNotice : public Module { nt = new NoNotice(ServerInstance); - Srv->AddMode(nt, 'T'); + ServerInstance->AddMode(nt, 'T'); } void Implements(char* List) @@ -81,7 +81,7 @@ class ModuleNoNotice : public Module chanrec* c = (chanrec*)dest; if (c->IsModeSet('T')) { - if ((Srv->IsUlined(user->server)) || (c->GetStatus(user) == STATUS_OP) || (c->GetStatus(user) == STATUS_HOP)) + if ((ServerInstance->IsUlined(user->server)) || (c->GetStatus(user) == STATUS_OP) || (c->GetStatus(user) == STATUS_HOP)) { // ops and halfops can still /NOTICE the channel return 0; diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp index cf05419c1..b6fe43549 100644 --- a/src/modules/m_operchans.cpp +++ b/src/modules/m_operchans.cpp @@ -58,7 +58,7 @@ class OperChans : public ModeHandler class ModuleOperChans : public Module { - Server* Srv; + OperChans* oc; public: ModuleOperChans(InspIRCd* Me) @@ -66,7 +66,7 @@ class ModuleOperChans : public Module { oc = new OperChans(ServerInstance); - Srv->AddMode(oc, 'O'); + ServerInstance->AddMode(oc, 'O'); } void Implements(char* List) diff --git a/src/modules/m_operjoin.cpp b/src/modules/m_operjoin.cpp index fd3b3407e..aa4e77772 100644 --- a/src/modules/m_operjoin.cpp +++ b/src/modules/m_operjoin.cpp @@ -17,7 +17,7 @@ class ModuleOperjoin : public Module private: std::string operChan; ConfigReader* conf; - Server* Srv; + int tokenize(const string &str, std::vector<std::string> &tokens) { diff --git a/src/modules/m_operlevels.cpp b/src/modules/m_operlevels.cpp index e6c64dcd0..f8129a532 100644 --- a/src/modules/m_operlevels.cpp +++ b/src/modules/m_operlevels.cpp @@ -16,7 +16,7 @@ class ModuleOperLevels : public Module private: - Server* Srv; + ConfigReader* conf; public: diff --git a/src/modules/m_operlog.cpp b/src/modules/m_operlog.cpp index 2bbd55de8..54c864a1c 100644 --- a/src/modules/m_operlog.cpp +++ b/src/modules/m_operlog.cpp @@ -28,7 +28,7 @@ using namespace std; class ModuleOperLog : public Module { private: - Server *Srv; + public: ModuleOperLog(InspIRCd* Me) : Module::Module(Me) { diff --git a/src/modules/m_opermd5.cpp b/src/modules/m_opermd5.cpp index 52692f772..f6b482eb4 100644 --- a/src/modules/m_opermd5.cpp +++ b/src/modules/m_opermd5.cpp @@ -288,7 +288,7 @@ class cmd_mkpasswd : public command_t class ModuleOperMD5 : public Module { - Server* Srv; + cmd_mkpasswd* mycommand; public: @@ -297,7 +297,7 @@ class ModuleOperMD5 : public Module { mycommand = new cmd_mkpasswd(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleOperMD5() diff --git a/src/modules/m_opermodes.cpp b/src/modules/m_opermodes.cpp index f03d68813..b354abf0a 100644 --- a/src/modules/m_opermodes.cpp +++ b/src/modules/m_opermodes.cpp @@ -28,7 +28,7 @@ class ModuleModesOnOper : public Module { private: - Server *Srv; + ConfigReader *Conf; public: @@ -79,7 +79,7 @@ class ModuleModesOnOper : public Module const char* modes[2]; modes[0] = user->nick; modes[1] = ThisOpersModes.c_str(); - Srv->SendMode(modes,2,user); + ServerInstance->SendMode(modes,2,user); } break; } diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp index d9be627e5..b28dc49ed 100644 --- a/src/modules/m_opermotd.cpp +++ b/src/modules/m_opermotd.cpp @@ -12,7 +12,7 @@ using namespace std; /* $ModDesc: Shows a message to opers after oper-up, adds /opermotd */ static FileReader* opermotd; -static Server* Srv; + void LoadOperMOTD() { @@ -68,7 +68,7 @@ class ModuleOpermotd : public Module { mycommand = new cmd_opermotd(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); opermotd = new FileReader(); LoadOperMOTD(); } diff --git a/src/modules/m_opersha256.cpp b/src/modules/m_opersha256.cpp index 74dad8315..451a2c195 100644 --- a/src/modules/m_opersha256.cpp +++ b/src/modules/m_opersha256.cpp @@ -47,7 +47,7 @@ using namespace std; #include "helperfuncs.h" #include "inspircd.h" -static Server *Srv; + #define SHA256_DIGEST_SIZE (256 / 8) #define SHA256_BLOCK_SIZE (512 / 8) @@ -251,7 +251,7 @@ public: { mksha256cmd = new cmd_mksha256(); - Srv->AddCommand(mksha256cmd); + ServerInstance->AddCommand(mksha256cmd); } virtual ~ModuleOperSHA256() diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index c21b7f413..153f208be 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -29,7 +29,7 @@ typedef std::map<std::string,std::string> override_t; class ModuleOverride : public Module { - Server *Srv; + override_t overrides; bool NoisyOverride; public: @@ -108,7 +108,7 @@ class ModuleOverride : public Module { if (*source->oper) { - if ((Srv) && (source) && (channel)) + if (source && channel) { // Fix by brain - allow the change if they arent on channel - rely on boolean short-circuit // to not check the other items in the statement if they arent on the channel diff --git a/src/modules/m_park.cpp b/src/modules/m_park.cpp index f6e2b69ac..41f39f1d4 100644 --- a/src/modules/m_park.cpp +++ b/src/modules/m_park.cpp @@ -49,7 +49,7 @@ class parkedinfo : public parking time_t parktime; }; -static Server *Srv; + typedef std::vector<awaymsg> awaylog; typedef std::vector<parkedinfo> parkinfo; parkinfo pinfo; @@ -235,9 +235,9 @@ class ModulePark : public Module cmd1 = new cmd_park(); cmd2 = new cmd_unpark(); cmd3 = new cmd_parkstats(); - Srv->AddCommand(cmd1); - Srv->AddCommand(cmd2); - Srv->AddCommand(cmd3); + ServerInstance->AddCommand(cmd1); + ServerInstance->AddCommand(cmd2); + ServerInstance->AddCommand(cmd3); } virtual ~ModulePark() diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp index 953a378eb..90ba8b4f2 100644 --- a/src/modules/m_randquote.cpp +++ b/src/modules/m_randquote.cpp @@ -22,7 +22,7 @@ using namespace std; #include "helperfuncs.h" #include "inspircd.h" -static Server *Srv; + static FileReader *quotes = NULL; std::string q_file = ""; @@ -109,7 +109,7 @@ class ModuleRandQuote : public Module { /* Hidden Command -- Mode clients assume /quote sends raw data to an IRCd >:D */ mycommand = new cmd_randquote(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } } diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp index 331b29f40..ae168730a 100644 --- a/src/modules/m_redirect.cpp +++ b/src/modules/m_redirect.cpp @@ -105,7 +105,7 @@ class Redirect : public ModeHandler class ModuleRedirect : public Module { - Server *Srv; + Redirect* re; public: @@ -115,7 +115,7 @@ class ModuleRedirect : public Module { re = new Redirect(ServerInstance); - Srv->AddMode(re, 'L'); + ServerInstance->AddMode(re, 'L'); } void Implements(char* List) diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index 9b7d1817c..a1533d64f 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -239,7 +239,7 @@ class ModuleRemove : public Module cmd_remove* mycommand; cmd_fpart* mycommand2; bool supportnokicks; - Server* Srv; + public: ModuleRemove(InspIRCd* Me) @@ -247,8 +247,8 @@ class ModuleRemove : public Module { mycommand = new cmd_remove(supportnokicks); mycommand2 = new cmd_fpart(supportnokicks); - Srv->AddCommand(mycommand); - Srv->AddCommand(mycommand2); + ServerInstance->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand2); OnRehash(""); } diff --git a/src/modules/m_restrictchans.cpp b/src/modules/m_restrictchans.cpp index 8889823c4..eb1feffa8 100644 --- a/src/modules/m_restrictchans.cpp +++ b/src/modules/m_restrictchans.cpp @@ -28,7 +28,7 @@ using namespace std; class ModuleRestrictChans : public Module { - Server* Srv; + std::map<irc::string,int> allowchans; diff --git a/src/modules/m_restrictmsg.cpp b/src/modules/m_restrictmsg.cpp index d8c54d30a..4b9a838b7 100644 --- a/src/modules/m_restrictmsg.cpp +++ b/src/modules/m_restrictmsg.cpp @@ -30,7 +30,7 @@ using namespace std; class ModuleRestrictMsg : public Module { - Server *Srv; + public: ModuleRestrictMsg(InspIRCd* Me) diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp index 4b8adc0cb..925af1c5d 100644 --- a/src/modules/m_safelist.cpp +++ b/src/modules/m_safelist.cpp @@ -55,7 +55,7 @@ class ListTimer : public InspTimer char buffer[MAXBUF]; chanrec *chan; - Server* Srv; + public: @@ -100,7 +100,7 @@ class ListTimer : public InspTimer log(DEBUG,"Channel %ld",ld->list_position); if (!ld->list_position) u->WriteServ("321 %s Channel :Users Name",u->nick); - chan = Srv->GetChannelIndex(ld->list_position); + chan = ServerInstance->GetChannelIndex(ld->list_position); /* spool details */ bool has_user = (chan && chan->HasUser(u)); if ((chan) && (((!(chan->modes[CM_PRIVATE])) && (!(chan->modes[CM_SECRET]))) || (has_user))) @@ -141,7 +141,7 @@ class ListTimer : public InspTimer class ModuleSafeList : public Module { private: - Server *Srv; + ListTimer* MyTimer; public: ModuleSafeList(InspIRCd* Me) : Module::Module(Me) diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index a170bc2bb..0dc507220 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -26,7 +26,7 @@ using namespace std; /* $ModDesc: Provides support for unreal-style SAJOIN command */ -static Server *Srv; + extern InspIRCd* ServerInstance; class cmd_sajoin : public command_t @@ -43,7 +43,7 @@ class cmd_sajoin : public command_t userrec* dest = ServerInstance->FindNick(parameters[0]); if (dest) { - if (Srv->IsUlined(dest->server)) + if (ServerInstance->IsUlined(dest->server)) { user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick); return; @@ -70,7 +70,7 @@ class ModuleSajoin : public Module { mycommand = new cmd_sajoin(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleSajoin() diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index 63e2a1f36..6ac963fa0 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -37,7 +37,7 @@ using namespace std; #include "modules.h" #include "inspircd.h" -static Server *Srv; + extern InspIRCd* ServerInstance; class cmd_samode : public command_t @@ -58,7 +58,7 @@ class cmd_samode : public command_t log(DEBUG,"SAMODE: Being handled"); userrec* n = new userrec(ServerInstance); n->fd = FD_MAGIC_NUMBER; - Srv->SendMode(parameters,pcnt,n); + ServerInstance->SendMode(parameters,pcnt,n); delete n; log(DEBUG,"SAMODE: Modechange handled"); result = std::string(user->nick); @@ -81,7 +81,7 @@ class ModuleSaMode : public Module { mycommand = new cmd_samode(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleSaMode() diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp index 65c9bcff9..b83be8f49 100644 --- a/src/modules/m_sanick.cpp +++ b/src/modules/m_sanick.cpp @@ -26,7 +26,7 @@ using namespace std; /* $ModDesc: Provides support for SANICK command */ extern InspIRCd* ServerInstance; -static Server *Srv; + class cmd_sanick : public command_t { @@ -42,7 +42,7 @@ class cmd_sanick : public command_t userrec* source = ServerInstance->FindNick(parameters[0]); if (source) { - if (Srv->IsUlined(source->server)) + if (ServerInstance->IsUlined(source->server)) { user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick); return; @@ -73,7 +73,7 @@ class ModuleSanick : public Module { mycommand = new cmd_sanick(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleSanick() diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 04286f6fc..b8a218bc3 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -26,7 +26,7 @@ using namespace std; /* $ModDesc: Provides support for unreal-style SAPART command */ -static Server *Srv; + extern InspIRCd* ServerInstance; class cmd_sapart : public command_t @@ -44,7 +44,7 @@ class cmd_sapart : public command_t chanrec* channel = ServerInstance->FindChan(parameters[1]); if (dest && channel) { - if (Srv->IsUlined(dest->server)) + if (ServerInstance->IsUlined(dest->server)) { user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick); return; @@ -66,7 +66,7 @@ class ModuleSapart : public Module { mycommand = new cmd_sapart(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleSapart() diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index 8ef0a70ab..7b216a6e8 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -35,7 +35,7 @@ using namespace std; /* $ModDesc: Provides support for an SAQUIT command, exits user with a reason */ -static Server *Srv; + extern InspIRCd* ServerInstance; class cmd_saquit : public command_t @@ -52,7 +52,7 @@ class cmd_saquit : public command_t userrec* dest = ServerInstance->FindNick(parameters[0]); if (dest) { - if (Srv->IsUlined(dest->server)) + if (ServerInstance->IsUlined(dest->server)) { user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick); return; @@ -79,7 +79,7 @@ class ModuleSaquit : public Module { mycommand = new cmd_saquit(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleSaquit() diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp index c58b4c005..0e7081e88 100644 --- a/src/modules/m_securelist.cpp +++ b/src/modules/m_securelist.cpp @@ -32,7 +32,7 @@ extern InspIRCd* ServerInstance; class ModuleSecureList : public Module { private: - Server *Srv; + public: ModuleSecureList(InspIRCd* Me) : Module::Module(Me) { diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp index ff80b8f1b..c7f2eca06 100644 --- a/src/modules/m_services.cpp +++ b/src/modules/m_services.cpp @@ -34,7 +34,7 @@ extern InspIRCd* ServerInstance; class Channel_r : public ModeHandler { - Server* Srv; + public: Channel_r(InspIRCd* Instance) : ModeHandler(Instance, 'r', 0, 0, false, MODETYPE_CHANNEL, false) { } @@ -58,7 +58,7 @@ class Channel_r : public ModeHandler class User_r : public ModeHandler { - Server* Srv; + public: User_r(InspIRCd* Instance) : ModeHandler(Instance, 'r', 0, 0, false, MODETYPE_USER, false) { } @@ -165,7 +165,7 @@ class Channel_M : public ModeHandler class ModuleServices : public Module { - Server *Srv; + Channel_r* m1; Channel_R* m2; Channel_M* m3; @@ -181,11 +181,11 @@ class ModuleServices : public Module m3 = new Channel_M(ServerInstance); m4 = new User_r(ServerInstance); m5 = new User_R(ServerInstance); - Srv->AddMode(m1, 'r'); - Srv->AddMode(m2, 'R'); - Srv->AddMode(m3, 'M'); - Srv->AddMode(m4, 'r'); - Srv->AddMode(m5, 'R'); + ServerInstance->AddMode(m1, 'r'); + ServerInstance->AddMode(m2, 'R'); + ServerInstance->AddMode(m3, 'M'); + ServerInstance->AddMode(m4, 'r'); + ServerInstance->AddMode(m5, 'R'); kludgeme = false; } @@ -218,7 +218,7 @@ class ModuleServices : public Module modechange[0] = user->nick; modechange[1] = "-r"; kludgeme = true; - Srv->SendMode(modechange,2,user); + ServerInstance->SendMode(modechange,2,user); kludgeme = false; } } diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 648191e3d..6248f6f03 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -115,7 +115,7 @@ class AChannel_M : public ModeHandler class ModuleServicesAccount : public Module { - Server *Srv; + AChannel_R* m1; AChannel_M* m2; AUser_R* m3; @@ -126,9 +126,9 @@ class ModuleServicesAccount : public Module m1 = new AChannel_R(ServerInstance); m2 = new AChannel_M(ServerInstance); m3 = new AUser_R(ServerInstance); - Srv->AddMode(m1, 'R'); - Srv->AddMode(m2, 'M'); - Srv->AddMode(m3, 'R'); + ServerInstance->AddMode(m1, 'R'); + ServerInstance->AddMode(m2, 'M'); + ServerInstance->AddMode(m3, 'R'); } virtual void On005Numeric(std::string &output) @@ -165,7 +165,7 @@ class ModuleServicesAccount : public Module if ((c->IsModeSet('M')) && (!account)) { - if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server)) || (!strcmp(user->server,""))) + if ((ServerInstance->IsUlined(user->nick)) || (ServerInstance->IsUlined(user->server)) || (!strcmp(user->server,""))) { // user is ulined, can speak regardless return 0; @@ -182,7 +182,7 @@ class ModuleServicesAccount : public Module if ((u->modes['R'-65]) && (!account)) { - if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server))) + if ((ServerInstance->IsUlined(user->nick)) || (ServerInstance->IsUlined(user->server))) { // user is ulined, can speak regardless return 0; @@ -212,7 +212,7 @@ class ModuleServicesAccount : public Module { if (!account) { - if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server))) + if ((ServerInstance->IsUlined(user->nick)) || (ServerInstance->IsUlined(user->server))) { // user is ulined, won't be stopped from joining return 0; diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index 7daccb293..65b03c3d0 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -26,7 +26,7 @@ using namespace std; /* $ModDesc: Provides support for the SETHOST command */ -static Server *Srv; + extern InspIRCd* ServerInstance; class cmd_sethost : public command_t @@ -71,7 +71,7 @@ class ModuleSetHost : public Module { mycommand = new cmd_sethost(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleSetHost() diff --git a/src/modules/m_setident.cpp b/src/modules/m_setident.cpp index ad14c786f..828f25792 100644 --- a/src/modules/m_setident.cpp +++ b/src/modules/m_setident.cpp @@ -5,7 +5,7 @@ /* $ModDesc: Provides support for the SETIDENT command */ -static Server *Srv; + extern InspIRCd* ServerInstance; class cmd_setident : public command_t @@ -43,7 +43,7 @@ class ModuleSetIdent : public Module { mycommand = new cmd_setident(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleSetIdent() diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp index 2c09422df..678c5f6f9 100644 --- a/src/modules/m_setidle.cpp +++ b/src/modules/m_setidle.cpp @@ -26,7 +26,6 @@ using namespace std; /* $ModDesc: Allows opers to set their idle time */ -static Server *Srv = NULL; extern InspIRCd* ServerInstance; class cmd_setidle : public command_t @@ -64,7 +63,7 @@ class ModuleSetIdle : public Module { mycommand = new cmd_setidle(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleSetIdle() diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp index 163f30f73..b07f9a391 100644 --- a/src/modules/m_setname.cpp +++ b/src/modules/m_setname.cpp @@ -22,10 +22,11 @@ using namespace std; #include "channels.h" #include "modules.h" #include "helperfuncs.h" +#include "inspircd.h" /* $ModDesc: Provides support for the SETNAME command */ -static Server *Srv; +extern InspIRCd* ServerInstance; class cmd_setname : public command_t { @@ -58,7 +59,7 @@ class ModuleSetName : public Module { mycommand = new cmd_setname(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleSetName() diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp index c94d58ec1..2f32b58de 100644 --- a/src/modules/m_showwhois.cpp +++ b/src/modules/m_showwhois.cpp @@ -47,7 +47,7 @@ class SeeWhois : public ModeHandler class ModuleShowwhois : public Module { - Server* Srv; + SeeWhois* sw; public: @@ -56,7 +56,7 @@ class ModuleShowwhois : public Module { sw = new SeeWhois(ServerInstance); - Srv->AddMode(sw, 'W'); + ServerInstance->AddMode(sw, 'W'); } ~ModuleShowwhois() diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index e912f0c13..cc73f8ead 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -134,7 +134,7 @@ class cmd_silence : public command_t class ModuleSilence : public Module { - Server *Srv; + cmd_silence* mycommand; public: @@ -143,7 +143,7 @@ class ModuleSilence : public Module { mycommand = new cmd_silence(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } void Implements(char* List) diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index ccd1714b3..62cd341b1 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -97,7 +97,7 @@ class TreeSocket; */ TreeServer *TreeRoot; -static Server* Srv; + /* This hash_map holds the hash equivalent of the server * tree, used for rapid linear lookups. @@ -582,7 +582,7 @@ TreeServer* FindServerMask(std::string ServerName) { for (server_hash::iterator i = serverlist.begin(); i != serverlist.end(); i++) { - if (Srv->MatchText(i->first.c_str(),ServerName)) + if (ServerInstance->MatchText(i->first.c_str(),ServerName)) return i->second; } return NULL; @@ -609,7 +609,7 @@ class cmd_rconnect : public command_t { user->WriteServ("NOTICE %s :*** RCONNECT: Sending remote connect to \002%s\002 to connect server \002%s\002.",user->nick,parameters[0],parameters[1]); /* Is this aimed at our server? */ - if (Srv->MatchText(ServerInstance->Config->ServerName,parameters[0])) + if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameters[0])) { /* Yes, initiate the given connect */ ServerInstance->WriteOpers("*** Remote CONNECT from %s matching \002%s\002, connecting server \002%s\002",user->nick,parameters[0],parameters[1]); @@ -1157,12 +1157,12 @@ class TreeSocket : public InspSocket if (smode) { log(DEBUG,"Send mode"); - Srv->SendMode(modelist, n+2, who); + ServerInstance->SendMode(modelist, n+2, who); } else { log(DEBUG,"Send mode client"); - Srv->CallCommandHandler("MODE", modelist, n+2, who); + ServerInstance->CallCommandHandler("MODE", modelist, n+2, who); } /* HOT POTATO! PASS IT ON! */ @@ -1171,7 +1171,7 @@ class TreeSocket : public InspSocket } else /* U-lined servers always win regardless of their TS */ - if ((TS > ourTS) && (!Srv->IsUlined(source))) + if ((TS > ourTS) && (!ServerInstance->IsUlined(source))) { /* Bounce the mode back to its sender.* We use our lower TS, so the other end * SHOULD accept it, if its clock is right. @@ -1284,15 +1284,15 @@ class TreeSocket : public InspSocket /* The server was ulined, but something iffy is up with the TS. * Sound the alarm bells! */ - if ((Srv->IsUlined(sourceserv)) && (TS > ourTS)) + if ((ServerInstance->IsUlined(sourceserv)) && (TS > ourTS)) { ServerInstance->WriteOpers("\2WARNING!\2 U-Lined server '%s' has bad TS for '%s' (accepted change): \2SYNC YOUR CLOCKS\2 to avoid this notice",sourceserv.c_str(),params[0].c_str()); } /* Allow the mode, route it to either server or user command handling */ if (smode) - Srv->SendMode(modelist,n,who); + ServerInstance->SendMode(modelist,n,who); else - Srv->CallCommandHandler("MODE", modelist, n, who); + ServerInstance->CallCommandHandler("MODE", modelist, n, who); /* HOT POTATO! PASS IT ON! */ DoOneToAllButSender(source,"FMODE",params,sourceserv); @@ -1428,11 +1428,11 @@ class TreeSocket : public InspSocket /* theres a mode for this user. push them onto the mode queue, and flush it * if there are more than MAXMODES to go. */ - if ((ourTS >= TS) || (Srv->IsUlined(who->server))) + if ((ourTS >= TS) || (ServerInstance->IsUlined(who->server))) { /* We also always let u-lined clients win, no matter what the TS value */ log(DEBUG,"Our our channel newer than theirs, accepting their modes"); - Srv->SendMode((const char**)mode_users,modectr,who); + ServerInstance->SendMode((const char**)mode_users,modectr,who); if (ourTS != TS) { log(DEFAULT,"Channel TS for %s changed from %lu to %lu",us->name,ourTS,TS); @@ -1473,7 +1473,7 @@ class TreeSocket : public InspSocket if (ourTS >= TS) { log(DEBUG,"Our our channel newer than theirs, accepting their modes"); - Srv->SendMode((const char**)mode_users,modectr,who); + ServerInstance->SendMode((const char**)mode_users,modectr,who); if (ourTS != TS) { log(DEFAULT,"Channel TS for %s changed from %lu to %lu",us->name,ourTS,TS); @@ -1930,7 +1930,7 @@ class TreeSocket : public InspSocket */ if (params.size() > 1) { - if (Srv->MatchText(ServerInstance->Config->ServerName, params[1])) + if (ServerInstance->MatchText(ServerInstance->Config->ServerName, params[1])) { /* It's for our server */ string_list results; @@ -2034,10 +2034,10 @@ class TreeSocket : public InspSocket std::string servermask = params[0]; - if (Srv->MatchText(ServerInstance->Config->ServerName,servermask)) + if (ServerInstance->MatchText(ServerInstance->Config->ServerName,servermask)) { ServerInstance->WriteOpers("*** Remote rehash initiated from server \002"+prefix+"\002."); - Srv->RehashServer(); + ServerInstance->RehashServer(); ReadConfiguration(false); } DoOneToAllButSender(prefix,"REHASH",params,prefix); @@ -2972,7 +2972,7 @@ class TreeSocket : public InspSocket { strparams[q] = params[q].c_str(); } - if (!Srv->CallCommandHandler(command.c_str(), strparams, params.size(), who)) + if (!ServerInstance->CallCommandHandler(command.c_str(), strparams, params.size(), who)) { this->WriteLine("ERROR :Unrecognised command '"+std::string(command.c_str())+"' -- possibly loaded mismatched modules"); return false; @@ -3059,7 +3059,7 @@ class TreeSocket : public InspSocket } } TreeSocket* s = new TreeSocket(this->Instance, newsock, ip); - Srv->AddSocket(s); + ServerInstance->AddSocket(s); return true; } }; @@ -3097,7 +3097,7 @@ class ServernameResolver : public Resolver if (newsocket->GetFd() > -1) { /* We're all OK */ - Srv->AddSocket(newsocket); + ServerInstance->AddSocket(newsocket); } else { @@ -3326,7 +3326,7 @@ void ReadConfiguration(bool rebind) TreeSocket* listener = new TreeSocket(ServerInstance, IP.c_str(),Port,true,10); if (listener->GetState() == I_LISTENING) { - Srv->AddSocket(listener); + ServerInstance->AddSocket(listener); Bindings.push_back(listener); } else @@ -3370,7 +3370,7 @@ void ReadConfiguration(bool rebind) try { SecurityIPResolver* sr = new SecurityIPResolver(ServerInstance, L.IPAddr, L); - Srv->AddResolver(sr); + ServerInstance->AddResolver(sr); } catch (ModuleException& e) { @@ -3432,7 +3432,7 @@ class ModuleSpanningTree : public Module ReadConfiguration(true); command_rconnect = new cmd_rconnect(this); - Srv->AddCommand(command_rconnect); + ServerInstance->AddCommand(command_rconnect); } void ShowLinks(TreeServer* Current, userrec* user, int hops) @@ -3444,7 +3444,7 @@ class ModuleSpanningTree : public Module } for (unsigned int q = 0; q < Current->ChildCount(); q++) { - if ((HideULines) && (Srv->IsUlined(Current->GetChild(q)->GetName()))) + if ((HideULines) && (ServerInstance->IsUlined(Current->GetChild(q)->GetName()))) { if (*user->oper) { @@ -3457,7 +3457,7 @@ class ModuleSpanningTree : public Module } } /* Don't display the line if its a uline, hide ulines is on, and the user isnt an oper */ - if ((HideULines) && (Srv->IsUlined(Current->GetName())) && (!*user->oper)) + if ((HideULines) && (ServerInstance->IsUlined(Current->GetName())) && (!*user->oper)) return; user->WriteServ("364 %s %s %s :%d %s",user->nick,Current->GetName().c_str(),(FlatLinks && (!*user->oper)) ? ServerInstance->Config->ServerName : Parent.c_str(),(FlatLinks && (!*user->oper)) ? 0 : hops,Current->GetDesc().c_str()); } @@ -3543,7 +3543,7 @@ class ModuleSpanningTree : public Module line++; for (unsigned int q = 0; q < Current->ChildCount(); q++) { - if ((HideULines) && (Srv->IsUlined(Current->GetChild(q)->GetName()))) + if ((HideULines) && (ServerInstance->IsUlined(Current->GetChild(q)->GetName()))) { if (*user->oper) { @@ -3663,7 +3663,7 @@ class ModuleSpanningTree : public Module log(DEBUG,"Splitting server %s",s->GetName().c_str()); ServerInstance->WriteOpers("*** SQUIT: Server \002%s\002 removed from network by %s",parameters[0],user->nick); sock->Squit(s,"Server quit by "+std::string(user->nick)+"!"+std::string(user->ident)+"@"+std::string(user->host)); - Srv->RemoveSocket(sock); + ServerInstance->RemoveSocket(sock); } else { @@ -3743,7 +3743,7 @@ class ModuleSpanningTree : public Module // they didnt answer, boot them ServerInstance->WriteOpers("*** Server \002%s\002 pinged out",serv->GetName().c_str()); sock->Squit(serv,"Ping timeout"); - Srv->RemoveSocket(sock); + ServerInstance->RemoveSocket(sock); return; } } @@ -3773,7 +3773,7 @@ class ModuleSpanningTree : public Module TreeSocket* newsocket = new TreeSocket(ServerInstance, x->IPAddr,x->Port,false,10,x->Name.c_str()); if (newsocket->GetFd() > -1) { - Srv->AddSocket(newsocket); + ServerInstance->AddSocket(newsocket); } else { @@ -3786,7 +3786,7 @@ class ModuleSpanningTree : public Module try { ServernameResolver* snr = new ServernameResolver(ServerInstance,x->IPAddr, *x); - Srv->AddResolver(snr); + ServerInstance->AddResolver(snr); } catch (ModuleException& e) { @@ -3840,7 +3840,7 @@ class ModuleSpanningTree : public Module { for (std::vector<Link>::iterator x = LinkBlocks.begin(); x < LinkBlocks.end(); x++) { - if (Srv->MatchText(x->Name.c_str(),parameters[0])) + if (ServerInstance->MatchText(x->Name.c_str(),parameters[0])) { TreeServer* CheckDupe = FindServer(x->Name.c_str()); if (!CheckDupe) @@ -3854,7 +3854,7 @@ class ModuleSpanningTree : public Module TreeSocket* newsocket = new TreeSocket(ServerInstance,x->IPAddr,x->Port,false,10,x->Name.c_str()); if (newsocket->GetFd() > -1) { - Srv->AddSocket(newsocket); + ServerInstance->AddSocket(newsocket); } else { @@ -3867,7 +3867,7 @@ class ModuleSpanningTree : public Module try { ServernameResolver* snr = new ServernameResolver(ServerInstance, x->IPAddr, *x); - Srv->AddResolver(snr); + ServerInstance->AddResolver(snr); } catch (ModuleException& e) { @@ -3953,7 +3953,7 @@ class ModuleSpanningTree : public Module this->HandleVersion(parameters,pcnt,user); return 1; } - else if (Srv->IsValidModuleCommand(command, pcnt, user)) + else if (ServerInstance->IsValidModuleCommand(command, pcnt, user)) { // this bit of code cleverly routes all module commands // to all remote severs *automatically* so that modules @@ -4268,10 +4268,10 @@ class ModuleSpanningTree : public Module params.push_back(parameter); DoOneToMany(ServerInstance->Config->ServerName,"REHASH",params); // check for self - if (Srv->MatchText(ServerInstance->Config->ServerName,parameter)) + if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameter)) { ServerInstance->WriteOpers("*** Remote rehash initiated from server \002%s\002",ServerInstance->Config->ServerName); - Srv->RehashServer(); + ServerInstance->RehashServer(); } } ReadConfiguration(false); diff --git a/src/modules/m_spy.cpp b/src/modules/m_spy.cpp index 55a1c6751..aa88fced6 100644 --- a/src/modules/m_spy.cpp +++ b/src/modules/m_spy.cpp @@ -45,7 +45,7 @@ using namespace std; #define nspace __gnu_cxx -static Server *Srv; + extern InspIRCd* ServerInstance; extern chan_hash chanlist; @@ -150,8 +150,8 @@ class ModuleSpy : public Module mycommand = new cmd_spylist(); mycommand2 = new cmd_spynames(); - Srv->AddCommand(mycommand); - Srv->AddCommand(mycommand2); + ServerInstance->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand2); } virtual ~ModuleSpy() diff --git a/src/modules/m_ssl_dummy.cpp b/src/modules/m_ssl_dummy.cpp index 5456be6f1..284d1d6cb 100644 --- a/src/modules/m_ssl_dummy.cpp +++ b/src/modules/m_ssl_dummy.cpp @@ -23,7 +23,7 @@ class ModuleSSLDummy : public Module { - Server* Srv; + char* dummy; public: diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp index 7638d42ca..a607f079e 100644 --- a/src/modules/m_sslmodes.cpp +++ b/src/modules/m_sslmodes.cpp @@ -56,7 +56,7 @@ class SSLMode : public ModeHandler class ModuleSSLModes : public Module { - Server *Srv; + SSLMode* sslm; public: @@ -66,7 +66,7 @@ class ModuleSSLModes : public Module sslm = new SSLMode(ServerInstance); - Srv->AddMode(sslm, 'z'); + ServerInstance->AddMode(sslm, 'z'); } void Implements(char* List) diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp index 935e3fe1b..db5a30f12 100644 --- a/src/modules/m_stripcolor.cpp +++ b/src/modules/m_stripcolor.cpp @@ -95,7 +95,7 @@ class UserStripColor : public ModeHandler class ModuleStripColor : public Module { - Server *Srv; + ConfigReader *Conf, *MyConf; ChannelStripColor *csc; UserStripColor *usc; @@ -109,8 +109,8 @@ class ModuleStripColor : public Module usc = new UserStripColor(ServerInstance); csc = new ChannelStripColor(ServerInstance); - Srv->AddMode(usc, 'S'); - Srv->AddMode(csc, 'S'); + ServerInstance->AddMode(usc, 'S'); + ServerInstance->AddMode(csc, 'S'); } void Implements(char* List) diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index b14cdcfc2..e9a4f8903 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -26,11 +26,10 @@ extern InspIRCd* ServerInstance; class cmd_swhois : public command_t { - Server* Srv; + public: - cmd_swhois(Server* server) : command_t("SWHOIS",'o',2) + cmd_swhois() : command_t("SWHOIS",'o',2) { - this->Srv = server; this->source = "m_swhois.so"; syntax = "<nick> <swhois>"; } @@ -56,14 +55,14 @@ class cmd_swhois : public command_t { // We already had it set... - if (!Srv->IsUlined(user->server)) + if (!ServerInstance->IsUlined(user->server)) // Ulines set SWHOISes silently ServerInstance->WriteOpers("*** %s used SWHOIS to set %s's extra whois from '%s' to '%s'", user->nick, dest->nick, text->c_str(), line.c_str()); dest->Shrink("swhois"); DELETE(text); } - else if(!Srv->IsUlined(user->server)) + else if(!ServerInstance->IsUlined(user->server)) { // Ulines set SWHOISes silently ServerInstance->WriteOpers("*** %s used SWHOIS to set %s's extra whois to '%s'", user->nick, dest->nick, line.c_str()); @@ -78,7 +77,7 @@ class cmd_swhois : public command_t class ModuleSWhois : public Module { cmd_swhois* mycommand; - Server* Srv; + ConfigReader* Conf; public: @@ -86,8 +85,8 @@ class ModuleSWhois : public Module { Conf = new ConfigReader(); - mycommand = new cmd_swhois(Srv); - Srv->AddCommand(mycommand); + mycommand = new cmd_swhois(); + ServerInstance->AddCommand(mycommand); } void OnRehash(const std::string ¶meter) diff --git a/src/modules/m_testcommand.cpp b/src/modules/m_testcommand.cpp index ffa79f2cd..5e3e57aa6 100644 --- a/src/modules/m_testcommand.cpp +++ b/src/modules/m_testcommand.cpp @@ -48,7 +48,7 @@ class MyV6Resolver : public Resolver } }; -static Server *Srv; + class cmd_woot : public command_t { @@ -66,9 +66,9 @@ class cmd_woot : public command_t try { MyV6Resolver* r = new MyV6Resolver("shake.stacken.kth.se", true); - Srv->AddResolver(r); + ServerInstance->AddResolver(r); r = new MyV6Resolver("2001:6b0:1:ea:202:a5ff:fecd:13a6", false); - Srv->AddResolver(r); + ServerInstance->AddResolver(r); } catch (ModuleException& e) { @@ -92,7 +92,7 @@ class ModuleTestCommand : public Module // anyone can issue the command, and the // command takes only one parameter. newcommand = new cmd_woot(); - Srv->AddCommand(newcommand); + ServerInstance->AddCommand(newcommand); } void Implements(char* List) diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index a0b5fe95f..a778ab4c6 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -28,7 +28,7 @@ using namespace std; #include "configreader.h" #include "inspircd.h" -static Server *Srv; + extern InspIRCd* ServerInstance; class TimedBan : public classbase @@ -59,7 +59,7 @@ class cmd_tban : public command_t int cm = channel->GetStatus(user); if ((cm == STATUS_HOP) || (cm == STATUS_OP)) { - if (!Srv->IsValidMask(parameters[2])) + if (!ServerInstance->IsValidMask(parameters[2])) { user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid ban mask"); return; @@ -74,14 +74,14 @@ class cmd_tban : public command_t } TimedBan T; std::string channelname = parameters[0]; - unsigned long expire = Srv->CalcDuration(parameters[1]) + time(NULL); - if (Srv->CalcDuration(parameters[1]) < 1) + unsigned long expire = ServerInstance->CalcDuration(parameters[1]) + time(NULL); + if (ServerInstance->CalcDuration(parameters[1]) < 1) { user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid ban time"); return; } char duration[MAXBUF]; - snprintf(duration,MAXBUF,"%lu",Srv->CalcDuration(parameters[1])); + snprintf(duration,MAXBUF,"%lu",ServerInstance->CalcDuration(parameters[1])); std::string mask = parameters[2]; const char *setban[32]; setban[0] = parameters[0]; @@ -89,7 +89,7 @@ class cmd_tban : public command_t setban[2] = parameters[2]; // use CallCommandHandler to make it so that the user sets the mode // themselves - Srv->CallCommandHandler("MODE",setban,3,user); + ServerInstance->CallCommandHandler("MODE",setban,3,user); /* Check if the ban was actually added (e.g. banlist was NOT full) */ bool was_added = false; for (BanList::iterator i = channel->bans.begin(); i != channel->bans.end(); i++) @@ -121,7 +121,7 @@ class ModuleTimedBans : public Module { mycommand = new cmd_tban(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); TimedBanList.clear(); } @@ -177,7 +177,7 @@ class ModuleTimedBans : public Module userrec* temp = new userrec(ServerInstance); temp->fd = FD_MAGIC_NUMBER; temp->server = ""; - Srv->SendMode(setban,3,temp); + ServerInstance->SendMode(setban,3,temp); /* FIX: Send mode remotely*/ std::deque<std::string> n; n.push_back(i->channel); diff --git a/src/modules/m_tline.cpp b/src/modules/m_tline.cpp index b35ad6d10..8ee58bc0c 100644 --- a/src/modules/m_tline.cpp +++ b/src/modules/m_tline.cpp @@ -27,7 +27,7 @@ using namespace std; /* $ModDesc: Provides /tline command used to test who a mask matches */ -static Server *Srv; + extern InspIRCd* ServerInstance; class cmd_tline : public command_t @@ -82,7 +82,7 @@ class ModuleTLine : public Module { newcommand = new cmd_tline(); - Srv->AddCommand(newcommand); + ServerInstance->AddCommand(newcommand); } void Implements(char* List) diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp index c7750a1e9..697e46908 100644 --- a/src/modules/m_uninvite.cpp +++ b/src/modules/m_uninvite.cpp @@ -26,7 +26,7 @@ using namespace std; #include "configreader.h" #include "inspircd.h" -static Server *Srv; + extern InspIRCd* ServerInstance; class cmd_uninvite : public command_t @@ -96,7 +96,7 @@ class ModuleUninvite : public Module { mycommand = new cmd_uninvite(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleUninvite() diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp index 861d5a0e5..35368d57f 100644 --- a/src/modules/m_userip.cpp +++ b/src/modules/m_userip.cpp @@ -26,7 +26,7 @@ using namespace std; /* $ModDesc: Provides support for USERIP command */ -static Server *Srv; + extern InspIRCd* ServerInstance; class cmd_userip : public command_t @@ -64,7 +64,7 @@ class ModuleUserIP : public Module { mycommand = new cmd_userip(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } void Implements(char* List) diff --git a/src/modules/m_vhost.cpp b/src/modules/m_vhost.cpp index cea5877b1..cff56d4b1 100644 --- a/src/modules/m_vhost.cpp +++ b/src/modules/m_vhost.cpp @@ -25,7 +25,7 @@ using namespace std; /* $ModDesc: Provides masking of user hostnames via traditional /VHOST command */ static ConfigReader *Conf; -static Server* Srv; + class cmd_vhost : public command_t { @@ -69,7 +69,7 @@ class ModuleVHost : public Module Conf = new ConfigReader; mycommand = new cmd_vhost(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } virtual ~ModuleVHost() diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index b352162a6..a01f58227 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -28,7 +28,7 @@ using namespace std; /* $ModDesc: Provides support for the /watch command */ -static Server *Srv; + extern InspIRCd* ServerInstance; class watchentry : public classbase @@ -207,7 +207,7 @@ class Modulewatch : public Module { mycommand = new cmd_watch(); - Srv->AddCommand(mycommand); + ServerInstance->AddCommand(mycommand); } void Implements(char* List) |