summaryrefslogtreecommitdiff
path: root/src/modules/m_setname.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-16 18:33:06 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-16 18:33:06 +0000
commit2e2d1fae4844088f7e0b9a71116e0eb3e149e4cc (patch)
tree544f6f31ec2c6f7714ebc4614a5623f6e6ec8a69 /src/modules/m_setname.cpp
parentab9d8fd1af3ebf028506ec543f74fd13471742dd (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_setname.cpp')
-rw-r--r--src/modules/m_setname.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp
index 3b2d98aae..892d934c0 100644
--- a/src/modules/m_setname.cpp
+++ b/src/modules/m_setname.cpp
@@ -26,27 +26,38 @@ using namespace std;
/* $ModDesc: Provides support for the SETNAME command */
Server *Srv;
-
-void handle_setname(char **parameters, int pcnt, userrec *user)
+
+class cmd_setname : public command_t
{
- std::string line = "";
- for (int i = 0; i < pcnt-1; i++)
+ public:
+ cmd_setname () : command_t("SETNAME", 0, 1);
{
- line = line + std::string(parameters[i]);
+ this->source = "m_setname.so";
}
- line = line + std::string(parameters[pcnt-1]);
- Srv->ChangeGECOS(user,line);
-}
+
+ void Handle (char **parameters, int pcnt, userrec *user)
+ {
+ std::string line = "";
+ for (int i = 0; i < pcnt-1; i++)
+ {
+ line = line + std::string(parameters[i]);
+ }
+ line = line + std::string(parameters[pcnt-1]);
+ Srv->ChangeGECOS(user,line);
+ }
+};
class ModuleSetName : public Module
{
+ cmd_setname* mycommand;
public:
ModuleSetName(Server* Me)
: Module::Module(Me)
{
Srv = Me;
- Srv->AddCommand("SETNAME",handle_setname,0,1,"m_setname.so");
+ mycommand = new cmd_setname();
+ Srv->AddCommand(mycommand);
}
virtual ~ModuleSetName()