X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_testnet.cpp;h=01d0406b06fe9c8267822eb3994641853f000a84;hb=226a95aab09b9e1f43f61e78179bfa1135816c2d;hp=0bc33f002f8c5e0c9a007b50ffef513ae87ba57d;hpb=0f87ad0d4b97874823c94a5168a06dcd444ad559;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_testnet.cpp b/src/modules/m_testnet.cpp index 0bc33f002..01d0406b0 100644 --- a/src/modules/m_testnet.cpp +++ b/src/modules/m_testnet.cpp @@ -1,16 +1,22 @@ -/* +------------------------------------+ - * | 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" @@ -18,6 +24,7 @@ struct vtbase { virtual void isok(const char* name, int impl, Module* basemod, std::vector& allmods) = 0; + virtual ~vtbase() {} }; template struct vtable : public vtbase @@ -145,8 +152,6 @@ static void checkall(Module* noimpl) CHK(OnEvent); CHK(OnGlobalOper); CHK(OnPostConnect); - CHK(OnAddBan); - CHK(OnDelBan); CHK(OnChangeLocalUserGECOS); CHK(OnUserRegister); CHK(OnChannelPreDelete); @@ -154,7 +159,6 @@ static void checkall(Module* noimpl) CHK(OnPostOper); CHK(OnSyncNetwork); CHK(OnSetAway); - CHK(OnUserList); CHK(OnPostCommand); CHK(OnPostJoin); CHK(OnWhoisLine); @@ -170,7 +174,6 @@ static void checkall(Module* noimpl) CHK(OnModuleRehash); CHK(OnSendWhoLine); CHK(OnChangeIdent); - CHK(OnChannelRestrictionApply); } class CommandTest : public Command @@ -194,11 +197,6 @@ class CommandTest : public Command { IS_LOCAL(user)->CommandFloodPenalty += atoi(parameters[1].c_str()); } - else if (parameters[0] == "shutdown" && IS_LOCAL(user)) - { - int i = parameters.size() > 1 ? atoi(parameters[1].c_str()) : 2; - ServerInstance->SE->Shutdown(IS_LOCAL(user)->GetFd(), i); - } else if (parameters[0] == "check") { checkall(creator); @@ -213,10 +211,14 @@ class ModuleTest : public Module CommandTest cmd; public: ModuleTest() : cmd(this) + { + } + + void init() { if (!strstr(ServerInstance->Config->ServerName.c_str(), ".test")) throw ModuleException("Don't load modules without reading their descriptions!"); - ServerInstance->AddCommand(&cmd); + ServerInstance->Modules->AddService(cmd); } Version GetVersion() @@ -226,4 +228,3 @@ class ModuleTest : public Module }; MODULE_INIT(ModuleTest) -