-/* +------------------------------------+
- * | 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 <danieldg@inspircd.org>
*
- * 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 <http://www.gnu.org/licenses/>.
*/
+
/* $ModDesc: Provides a module for testing the server while linked in a network */
#include "inspircd.h"
struct vtbase
{
virtual void isok(const char* name, int impl, Module* basemod, std::vector<std::string>& allmods) = 0;
+ virtual ~vtbase() {}
};
template<typename T> struct vtable : public vtbase
CHK(OnPostOper);
CHK(OnSyncNetwork);
CHK(OnSetAway);
- CHK(OnUserList);
CHK(OnPostCommand);
CHK(OnPostJoin);
CHK(OnWhoisLine);
CHK(OnModuleRehash);
CHK(OnSendWhoLine);
CHK(OnChangeIdent);
- CHK(OnChannelRestrictionApply);
}
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);
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()