From 293df6a8b55e89c127e60e92711ef0ef1027bff8 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 16 Dec 2005 18:10:38 +0000 Subject: Split all commands into seperate files and redid command system to take classes, not function pointers (function pointers suck ass) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2534 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_opermotd.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/modules/m_opermotd.cpp') 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(); } -- cgit v1.2.3