X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_testnet.cpp;h=6e05ed681662f53c156804e828d13e9afa3d8874;hb=63aa8d0d42f619c52d382bde3e6ba2e5e23b12ac;hp=e467923c976c4b78430118b24de6d6d7c01143f4;hpb=6fe52cbb3ba72a5ecdded3f51c8515bf75e6801f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_testnet.cpp b/src/modules/m_testnet.cpp index e467923c9..6e05ed681 100644 --- a/src/modules/m_testnet.cpp +++ b/src/modules/m_testnet.cpp @@ -1,17 +1,21 @@ -/* +------------------------------------+ - * | 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) 2009 Daniel De Graaf * - * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ -/* $ModDesc: Provides a module for testing the server while linked in a network */ #include "inspircd.h" @@ -32,14 +36,9 @@ class CommandTest : public Command for(unsigned int i=0; i < count; i++) user->Write(line); } - else if (parameters[0] == "freeze" && IS_LOCAL(user)) - { - IS_LOCAL(user)->Penalty += 100; - } - else if (parameters[0] == "shutdown" && IS_LOCAL(user)) + else if (parameters[0] == "freeze" && IS_LOCAL(user) && parameters.size() > 1) { - int i = parameters.size() > 1 ? atoi(parameters[1].c_str()) : 2; - ServerInstance->SE->Shutdown(IS_LOCAL(user)->GetFd(), i); + IS_LOCAL(user)->CommandFloodPenalty += atoi(parameters[1].c_str()); } return CMD_SUCCESS; } @@ -50,17 +49,19 @@ class ModuleTest : public Module CommandTest cmd; public: ModuleTest() : cmd(this) + { + } + + void init() CXX11_OVERRIDE { if (!strstr(ServerInstance->Config->ServerName.c_str(), ".test")) throw ModuleException("Don't load modules without reading their descriptions!"); - ServerInstance->AddCommand(&cmd); } - Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { return Version("Provides a module for testing the server while linked in a network", VF_VENDOR|VF_OPTCOMMON); } }; MODULE_INIT(ModuleTest) -