X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_clones.cpp;h=9742ea29d6c714797c01229c871f952a71a6c16b;hb=26cd5393c9308fabe73c41870f06f73a5b001cd7;hp=eb2c6cd3d915aaefc75312ab1065a5c59d3d25b1;hpb=449bbb6e04f73685341fc22acb4b579794bd56ac;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_clones.cpp b/src/modules/m_clones.cpp index eb2c6cd3d..9742ea29d 100644 --- a/src/modules/m_clones.cpp +++ b/src/modules/m_clones.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -12,27 +12,25 @@ */ #include "inspircd.h" -#include "wildcard.h" -/* $ModDesc: Provides the /clones command to retrieve information on a user, channel, or IP address */ +/* $ModDesc: Provides the /clones command to retrieve information on clones. */ /** Handle /CHECK */ class CommandClones : public Command { public: - CommandClones (InspIRCd* Instance) : Command(Instance,"CLONES", "o", 1) + CommandClones(Module* Creator) : Command(Creator,"CLONES", 1) { - this->source = "m_clones.so"; - syntax = ""; + flags_needed = 'o'; syntax = ""; } - CmdResult Handle (const char** parameters, int pcnt, User *user) + CmdResult Handle (const std::vector ¶meters, User *user) { std::string clonesstr = "304 " + std::string(user->nick) + " :CLONES"; - unsigned long limit = atoi(parameters[0]); + unsigned long limit = atoi(parameters[0].c_str()); /* * Syntax of a /clones reply: @@ -53,7 +51,7 @@ class CommandClones : public Command user->WriteServ(clonesstr + " END"); - return CMD_LOCALONLY; + return CMD_SUCCESS; } }; @@ -61,26 +59,23 @@ class CommandClones : public Command class ModuleClones : public Module { private: - CommandClones *mycommand; + CommandClones cmd; public: - ModuleClones(InspIRCd* Me) : Module(Me) + ModuleClones() : cmd(this) { - - mycommand = new CommandClones(ServerInstance); - ServerInstance->AddCommand(mycommand); - + ServerInstance->AddCommand(&cmd); } - + virtual ~ModuleClones() { } - + virtual Version GetVersion() { - return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION); + return Version("Provides the /clones command to retrieve information on clones.", VF_VENDOR, API_VERSION); } - + }; MODULE_INIT(ModuleClones)