X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_close.cpp;h=8b0ea3417a081a0c5af4eaaad2d74ce354402d48;hb=91c34d4e971dcc9370d205ff6d8189cd92f1d556;hp=a2e9692cdbf2c38b7c814d2fd01f33e26bd139b5;hpb=7c1352df0c8bb2624d4f2cc8320467578c39a6ad;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_close.cpp b/src/modules/m_close.cpp index a2e9692cd..8b0ea3417 100644 --- a/src/modules/m_close.cpp +++ b/src/modules/m_close.cpp @@ -1,24 +1,23 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2007 Carsten Valdemar Munk * - * This program is free but copyrighted software; see - * the file COPYING for details. + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. * - * --------------------------------------------------- + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * Based on the UnrealIRCd 4.0 (1.1.x fork) module - * - * UnrealIRCd 4.0 (C) 2007 Carsten Valdemar Munk - * This program is free but copyrighted software; see - * the file COPYING for details. - * - * --------------------------------------------------- + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + #include "inspircd.h" /* $ModDesc: Provides /CLOSE functionality */ @@ -37,10 +36,9 @@ class CommandClose : public Command { std::map closed; - std::vector::reverse_iterator u = ServerInstance->Users->local_users.rbegin(); - while (u != ServerInstance->Users->local_users.rend()) + for (LocalUserList::const_iterator u = ServerInstance->Users->local_users.begin(); u != ServerInstance->Users->local_users.end(); ++u) { - User* user = *u++; + LocalUser* user = *u; if (user->registered != REG_ALL) { ServerInstance->Users->QuitUser(user, "Closing all unknown connections per request"); @@ -71,7 +69,11 @@ class ModuleClose : public Module ModuleClose() : cmd(this) { - ServerInstance->AddCommand(&cmd); + } + + void init() + { + ServerInstance->Modules->AddService(cmd); } virtual ~ModuleClose() @@ -80,7 +82,7 @@ class ModuleClose : public Module virtual Version GetVersion() { - return Version("Provides /CLOSE functionality", VF_VENDOR, API_VERSION); + return Version("Provides /CLOSE functionality", VF_VENDOR); } };