X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_hostchange.cpp;h=3d036621424b7a3ea2af363de3ee4639735e0b31;hb=2e52ff280dca14d1598b84fab7a8c2e93fa30910;hp=354eea3ed3489659727c3224de596e1828885f71;hpb=6d4128715da39b1e097642a64ee0bd40586d9a38;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp index 354eea3ed..3d0366214 100644 --- a/src/modules/m_hostchange.cpp +++ b/src/modules/m_hostchange.cpp @@ -24,6 +24,8 @@ using namespace std; /* $ModDesc: Provides masking of user hostnames in a different way to m_cloaking */ +/** Holds information on a host set by m_hostchange + */ class Host : public classbase { public: @@ -37,17 +39,17 @@ class ModuleHostChange : public Module { private: - Server *Srv; + ConfigReader *Conf; hostchanges_t hostchanges; std::string MySuffix; public: - ModuleHostChange(Server* Me) + ModuleHostChange(InspIRCd* Me) : Module::Module(Me) { - Srv = Me; - Conf = new ConfigReader; + + Conf = new ConfigReader(ServerInstance); OnRehash(""); } @@ -58,7 +60,7 @@ class ModuleHostChange : public Module Priority Prioritize() { - return (Priority)Srv->PriorityAfter("m_cloaking.so"); + return (Priority)ServerInstance->PriorityAfter("m_cloaking.so"); } void Implements(char* List) @@ -69,7 +71,7 @@ class ModuleHostChange : public Module virtual void OnRehash(const std::string ¶meter) { DELETE(Conf); - Conf = new ConfigReader; + Conf = new ConfigReader(ServerInstance); MySuffix = Conf->ReadValue("host","suffix",0); for (hostchanges_t::iterator i = hostchanges.begin(); i != hostchanges.end(); i++) { @@ -92,14 +94,14 @@ class ModuleHostChange : public Module { // returns the version number of the module to be // listed in /MODULES - return Version(1,0,0,1,VF_VENDOR); + return Version(1,1,0,1,VF_VENDOR,API_VERSION); } virtual void OnUserConnect(userrec* user) { 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 @@ -156,7 +158,7 @@ class ModuleHostChangeFactory : public ModuleFactory { } - virtual Module * CreateModule(Server* Me) + virtual Module * CreateModule(InspIRCd* Me) { return new ModuleHostChange(Me); }