From ab9d8fd1af3ebf028506ec543f74fd13471742dd Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 16 Dec 2005 18:23:50 +0000 Subject: Porting to new command system git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2535 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_samode.cpp | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'src/modules/m_samode.cpp') diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index e60f8bf03..fe699eb9a 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -38,34 +38,44 @@ using namespace std; Server *Srv; - -void handle_samode(char **parameters, int pcnt, userrec *user) +class cmd_samode : public command_t { - /* - * Handles an SAMODE request. Notifies all +s users. - */ - int n=0; - std::string result; - Srv->Log(DEBUG,"SAMODE: Being handled"); - Srv->SendMode(parameters,pcnt,user); - Srv->Log(DEBUG,"SAMODE: Modechange handled"); - result = std::string(user->nick) + std::string(" used SAMODE "); - while (nsource = "m_samode.so"; } - Srv->SendOpers(result); -} + + void Handle (char **parameters, int pcnt, userrec *user) + { + /* + * Handles an SAMODE request. Notifies all +s users. + */ + int n=0; + std::string result; + Srv->Log(DEBUG,"SAMODE: Being handled"); + Srv->SendMode(parameters,pcnt,user); + Srv->Log(DEBUG,"SAMODE: Modechange handled"); + result = std::string(user->nick) + std::string(" used SAMODE "); + while (nSendOpers(result); + } +}; class ModuleSaMode : public Module { + cmd_samode* mycommand; public: ModuleSaMode(Server* Me) : Module::Module(Me) { Srv = Me; - Srv->AddCommand("SAMODE",handle_samode,'o',2,"m_samode.so"); + mycommand = new cmd_samode(); + Srv->AddCommand(mycommand); } virtual ~ModuleSaMode() -- cgit v1.2.3