]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_close.cpp
Finally change all the Version() objects
[user/henk/code/inspircd.git] / src / modules / m_close.cpp
index 93328a5a95814dbbfefd9588f428721cbc0173c6..4d5c02d58b1e3d887ba97c308bc22e56f962c90c 100644 (file)
@@ -2,7 +2,7 @@
  *       | UnrealIRCd v4.0                    |
  *       +------------------------------------+
  *
- * UnrealIRCd 4.0 (C) 2007 Carsten Valdemar Munk 
+ * UnrealIRCd 4.0 (C) 2008 Carsten Valdemar Munk 
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
  *
  */
 
 #include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 
 /* $ModDesc: Provides /CLOSE functionality */
 
 /** Handle /CLOSE
  */
-class cmd_close : public command_t
+class CommandClose : public Command
 {
  public:
        /* Command 'close', needs operator */
-       cmd_close (InspIRCd* Instance) : command_t(Instance,"CLOSE", 'o', 0)
+       CommandClose (InspIRCd* Instance) : Command(Instance,"CLOSE", "o", 0)
        {
                this->source = "m_close.so";
        }
 
-       CmdResult Handle (const char** parameters, int pcnt, userrec *user)
+       CmdResult Handle (const char* const* parameters, int pcnt, User *user)
        {
                std::map<std::string,int> closed;
 
-               for (std::vector<userrec*>::iterator u = ServerInstance->local_users.begin(); u != ServerInstance->local_users.end(); u++)
+               for (std::vector<User*>::iterator u = ServerInstance->Users->local_users.begin(); u != ServerInstance->Users->local_users.end(); u++)
                {
                        if ((*u)->registered != REG_ALL)
                        {
-                               userrec::QuitUser(ServerInstance, *u, "Closing all unknown connections per request");
+                               User::QuitUser(ServerInstance, *u, "Closing all unknown connections per request");
                                std::string key = ConvToStr((*u)->GetIPString())+"."+ConvToStr((*u)->GetPort());
                                closed[key]++;
                        }
@@ -58,14 +55,15 @@ class cmd_close : public command_t
 
 class ModuleClose : public Module
 {
-       cmd_close* newcommand;
+       CommandClose* newcommand;
  public:
        ModuleClose(InspIRCd* Me)
                : Module(Me)
        {
                // Create a new command
-               newcommand = new cmd_close(ServerInstance);
+               newcommand = new CommandClose(ServerInstance);
                ServerInstance->AddCommand(newcommand);
+
        }
 
        virtual ~ModuleClose()
@@ -74,7 +72,7 @@ class ModuleClose : public Module
 
        virtual Version GetVersion()
        {
-               return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);
+               return Version(1, 2, 0, 0, VF_VENDOR, API_VERSION);
        }
 };