X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_close.cpp;h=ebffc68647f04c3e5f9a3e81011f0a7457183b83;hb=93425ec211be8185fa9a428dcb24bc8b8121f917;hp=93328a5a95814dbbfefd9588f428721cbc0173c6;hpb=1f178250c7ea3ce5e02b94a3437f98ccaa62d701;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_close.cpp b/src/modules/m_close.cpp index 93328a5a9..ebffc6864 100644 --- a/src/modules/m_close.cpp +++ b/src/modules/m_close.cpp @@ -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. * @@ -10,32 +10,29 @@ */ #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 closed; - for (std::vector::iterator u = ServerInstance->local_users.begin(); u != ServerInstance->local_users.end(); u++) + for (std::vector::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()