X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_opermotd.cpp;h=7fd19122b64d4f5a1b89ac9468e2b23b49dac8da;hb=ea7aa89d61f5090ee7e7ecbe9eb633e1189ce40a;hp=a2a3c0312d8428849900186c376597f2c5f7e6f7;hpb=2d821f2980825be73e3f90b47ffff365b0ec5ecb;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp index a2a3c0312..7fd19122b 100644 --- a/src/modules/m_opermotd.cpp +++ b/src/modules/m_opermotd.cpp @@ -13,8 +13,6 @@ using namespace std; FileReader* opermotd; Server* Srv; -void do_opermotd(char** parameters, int pcnt, userrec* user); - void LoadOperMOTD() { ConfigReader* conf = new ConfigReader; @@ -45,20 +43,30 @@ void ShowOperMOTD(userrec* user) } -void do_opermotd(char** parameters, int pcnt, userrec* user) +class cmd_opermotd : public command_t { - ShowOperMOTD(user); -} + public: + cmd_opermotd () : command_t("OPERMOTD", 'o', 0) + { + this->source = "m_opermotd.so"; + } + + void Handle (char** parameters, int pcnt, userrec* user) + { + ShowOperMOTD(user); + } +}; class ModuleOpermotd : public Module { + cmd_opermotd* mycommand; public: ModuleOpermotd(Server* Me) : Module::Module(Me) { Srv = Me; - - Srv->AddCommand("OPERMOTD",do_opermotd,'o',0,"m_opermotd.so"); + mycommand = new cmd_opermotd(); + Srv->AddCommand(mycommand); opermotd = new FileReader(); LoadOperMOTD(); }