X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_clearcache.cpp;h=5914f9a8f0ef4a21a9300ed19c9c4693fd252e29;hb=4c751dbbe8945e5efc230a59b0ed51c2ba10cf92;hp=c7354df07d824ed9a95e91b52f06074e63d08ae3;hpb=dd36852a52e8541306b76c5b88bce8ab9b36654c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_clearcache.cpp b/src/commands/cmd_clearcache.cpp index c7354df07..5914f9a8f 100644 --- a/src/commands/cmd_clearcache.cpp +++ b/src/commands/cmd_clearcache.cpp @@ -1,29 +1,52 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * Copyright (C) 2009 Daniel De Graaf + * Copyright (C) 2007 Robin Burchell * - * 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 . */ + #include "inspircd.h" -#include "commands/cmd_clearcache.h" -extern "C" DllExport Command* init_command(InspIRCd* Instance) +/** Handle /CLEARCACHE. These command handlers can be reloaded by the core, + * and handle basic RFC1459 commands. Commands within modules work + * the same way, however, they can be fully unloaded, where these + * may not. + */ +class CommandClearcache : public Command { - return new CommandClearcache(Instance); -} + public: + /** Constructor for clearcache. + */ + CommandClearcache ( Module* parent) : Command(parent,"CLEARCACHE",0) { flags_needed = 'o'; } + /** Handle command. + * @param parameters The parameters to the comamnd + * @param pcnt The number of parameters passed to teh command + * @param user The user issuing the command + * @return A value from CmdResult to indicate command success or failure. + */ + CmdResult Handle(const std::vector& parameters, User *user); +}; /** Handle /CLEARCACHE */ -CmdResult CommandClearcache::Handle (const char* const* parameters, int pcnt, User *user) +CmdResult CommandClearcache::Handle (const std::vector& parameters, User *user) { int n = ServerInstance->Res->ClearCache(); - user->WriteServ("NOTICE %s :*** Cleared DNS cache of %d items.", user->nick, n); + user->WriteServ("NOTICE %s :*** Cleared DNS cache of %d items.", user->nick.c_str(), n); return CMD_SUCCESS; } + +COMMAND_INIT(CommandClearcache)