diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-16 18:33:06 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-16 18:33:06 +0000 |
commit | 2e2d1fae4844088f7e0b9a71116e0eb3e149e4cc (patch) | |
tree | 544f6f31ec2c6f7714ebc4614a5623f6e6ec8a69 /src/modules/m_saquit.cpp | |
parent | ab9d8fd1af3ebf028506ec543f74fd13471742dd (diff) |
Moved to new command system
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2536 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_saquit.cpp')
-rw-r--r-- | src/modules/m_saquit.cpp | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index e864546e0..e1db742e0 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -35,33 +35,43 @@ using namespace std; /* $ModDesc: Provides support for an SAQUIT command, exits user with a reason */ Server *Srv; - -void handle_saquit(char **parameters, int pcnt, userrec *user) + +class cmd_saquit : public command_t { - userrec* dest = Srv->FindNick(std::string(parameters[0])); - if (dest) + public: + cmd_saquit () : command_t("SAQUIT",'o',2) + { + this->source = "m_saquit.so"; + } + + void Handle (char **parameters, int pcnt, userrec *user) { - std::string line = ""; - for (int i = 1; i < pcnt - 1; i++) + userrec* dest = Srv->FindNick(std::string(parameters[0])); + if (dest) { - line = line + std::string(parameters[i]) + " "; + std::string line = ""; + for (int i = 1; i < pcnt - 1; i++) + { + line = line + std::string(parameters[i]) + " "; + } + line = line + std::string(parameters[pcnt-1]); + + Srv->SendOpers(std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+line); + Srv->QuitUser(dest, line); } - line = line + std::string(parameters[pcnt-1]); - - Srv->SendOpers(std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+line); - Srv->QuitUser(dest, line); } -} - +}; class ModuleSaquit : public Module { + cmd_saquit* mycommand; public: ModuleSaquit(Server* Me) : Module::Module(Me) { Srv = Me; - Srv->AddCommand("SAQUIT",handle_saquit,'o',2,"m_saquit.so"); + mycommand = new cmd_saquit(); + Srv->AddCommand(mycommand); } virtual ~ModuleSaquit() |