]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_opermotd.cpp
Fixed compile problems... Move along please, nothing to see here..
[user/henk/code/inspircd.git] / src / modules / m_opermotd.cpp
index a2a3c0312d8428849900186c376597f2c5f7e6f7..7fd19122b64d4f5a1b89ac9468e2b23b49dac8da 100644 (file)
@@ -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();
                }