X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_hostchange.cpp;h=7fb14a1baebb10655142d410e09f2bdee663e7eb;hb=43fe72edad4c5dfd1a3a700bea17c8ee7a7c3d8e;hp=21566daac8994b22056b8c11e802aeecd69593fd;hpb=38749462c62a659b7006976c2c7c4da6ac6d0df7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp index 21566daac..7fb14a1ba 100644 --- a/src/modules/m_hostchange.cpp +++ b/src/modules/m_hostchange.cpp @@ -14,6 +14,8 @@ * --------------------------------------------------- */ +using namespace std; + #include #include "users.h" #include "channels.h" @@ -30,22 +32,20 @@ class ModuleHostChange : public Module std::string MySuffix; public: - ModuleHostChange() + ModuleHostChange(Server* Me) + : Module::Module(Me) { - // We must create an instance of the Server class to work with - Srv = new Server; + Srv = Me; Conf = new ConfigReader; MySuffix = Conf->ReadValue("host","suffix",0); } virtual ~ModuleHostChange() { - // not really neccessary, but free it anyway - delete Srv; delete Conf; } - virtual void OnRehash() + virtual void OnRehash(std::string parameter) { delete Conf; Conf = new ConfigReader; @@ -56,7 +56,7 @@ class ModuleHostChange : public Module { // returns the version number of the module to be // listed in /MODULES - return Version(1,0,0,1); + return Version(1,0,0,1,VF_VENDOR); } virtual void OnUserConnect(userrec* user) @@ -82,7 +82,7 @@ class ModuleHostChange : public Module // first take their nick and strip out non-dns, leaving just [A-Z0-9\-] std::string complete = ""; std::string old = user->nick; - for (int j = 0; j < old.length(); j++) + for (unsigned int j = 0; j < old.length(); j++) { if (((old[j] >= 'A') && (old[j] <= 'Z')) || ((old[j] >= 'a') && (old[j] <= 'z')) || @@ -120,9 +120,9 @@ class ModuleHostChangeFactory : public ModuleFactory { } - virtual Module * CreateModule() + virtual Module * CreateModule(Server* Me) { - return new ModuleHostChange; + return new ModuleHostChange(Me); } };