diff options
Diffstat (limited to 'src/modules/m_sethost.cpp')
-rw-r--r-- | src/modules/m_sethost.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index 2ef0c0548..e3e02fbe8 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -27,8 +27,8 @@ */ class CommandSethost : public Command { - private: char* hostmap; + public: CommandSethost(Module* Creator, char* hmap) : Command(Creator,"SETHOST", 1), hostmap(hmap) { @@ -44,14 +44,14 @@ class CommandSethost : public Command { if (!hostmap[(const unsigned char)*x]) { - user->WriteServ("NOTICE "+user->nick+" :*** SETHOST: Invalid characters in hostname"); + user->WriteNotice("*** SETHOST: Invalid characters in hostname"); return CMD_FAILURE; } } if (len > 64) { - user->WriteServ("NOTICE %s :*** SETHOST: Host too long",user->nick.c_str()); + user->WriteNotice("*** SETHOST: Host too long"); return CMD_FAILURE; } @@ -70,13 +70,14 @@ class ModuleSetHost : public Module { CommandSethost cmd; char hostmap[256]; + public: ModuleSetHost() : cmd(this, hostmap) { } - void init() + void init() CXX11_OVERRIDE { OnRehash(NULL); ServerInstance->Modules->AddService(cmd); @@ -84,7 +85,7 @@ class ModuleSetHost : public Module ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } - void OnRehash(User* user) + void OnRehash(User* user) CXX11_OVERRIDE { std::string hmap = ServerInstance->Config->ConfValue("hostname")->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789"); @@ -93,15 +94,10 @@ class ModuleSetHost : public Module hostmap[(unsigned char)*n] = 1; } - virtual ~ModuleSetHost() - { - } - - virtual Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { return Version("Provides support for the SETHOST command", VF_VENDOR); } - }; MODULE_INIT(ModuleSetHost) |