]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_clones.cpp
The module hook is kinda required.
[user/henk/code/inspircd.git] / src / modules / m_clones.cpp
index 98c901d7d52dada0ff11fb0f69a30f38344a708d..ebf98d3e8ec1ebf226f3302b8b3c52b4fe6763c2 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
  */
 
 #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 (InspIRCd* Instance) : Command(Instance,"CLONES", "o", 1)
        {
                this->source = "m_clones.so";
                syntax = "<limit>";
        }
 
-       CmdResult Handle (const char** parameters, int pcnt, User *user)
+       CmdResult Handle (const std::vector<std::string> &parameters, 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:
@@ -44,7 +43,8 @@ class CommandClones : public Command
                user->WriteServ(clonesstr + " START");
 
                /* hostname or other */
-               for (clonemap::iterator x = ServerInstance->global_clones.begin(); x != ServerInstance->global_clones.end(); x++)
+               // XXX I really don't like marking global_clones public for this. at all. -- w00t
+               for (clonemap::iterator x = ServerInstance->Users->global_clones.begin(); x != ServerInstance->Users->global_clones.end(); x++)
                {
                        if (x->second >= limit)
                                user->WriteServ(clonesstr + " "+ ConvToStr(x->second) + " " + assign(x->first));
@@ -64,22 +64,22 @@ class ModuleClones : public Module
  public:
        ModuleClones(InspIRCd* Me) : Module(Me)
        {
-               
+
                mycommand = new CommandClones(ServerInstance);
                ServerInstance->AddCommand(mycommand);
 
        }
-       
+
        virtual ~ModuleClones()
        {
        }
-       
+
        virtual Version GetVersion()
        {
-               return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);
+               return Version("$Id$", VF_VENDOR, API_VERSION);
        }
 
-       
+
 };
 
 MODULE_INIT(ModuleClones)