X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcmd_rehash.cpp;h=f53f810a49544ef94acfb3c2611a999af804940a;hb=dc7927e17cffb2ee3c50ef9f037ed873d378f679;hp=16fe3e058f57055f929c2c3d31e819c013944a21;hpb=a9b90ecb4329498aba52da6aaa9812e3a70b8e11;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cmd_rehash.cpp b/src/cmd_rehash.cpp index 16fe3e058..f53f810a4 100644 --- a/src/cmd_rehash.cpp +++ b/src/cmd_rehash.cpp @@ -2,10 +2,10 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * Inspire is copyright (C) 2002-2005 ChatSpike-Dev. + * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev. * E-mail: - * - * + * + * * * Written by Craig Edwards, Craig McLure, and others. * This program is free but copyrighted software; see @@ -14,57 +14,21 @@ * --------------------------------------------------- */ -using namespace std; - -#include "inspircd_config.h" -#include "inspircd.h" -#include "inspircd_io.h" -#include -#include -#ifdef GCC3 -#include -#else -#include -#endif -#include -#include -#include -#include +#include "configreader.h" #include "users.h" -#include "ctables.h" -#include "globals.h" #include "modules.h" -#include "dynamic.h" -#include "wildcard.h" -#include "message.h" -#include "commands.h" -#include "mode.h" -#include "xline.h" -#include "inspstring.h" -#include "dnsqueue.h" -#include "helperfuncs.h" -#include "hashcomp.h" -#include "socketengine.h" -#include "typedefs.h" -#include "command_parse.h" -#include "cmd_rehash.h" +#include "commands/cmd_rehash.h" + -extern ServerConfig* Config; -extern InspIRCd* ServerInstance; -extern int MODCOUNT; -extern std::vector modules; -extern std::vector factory; -extern time_t TIME; -extern user_hash clientlist; -extern chan_hash chanlist; -extern whowas_hash whowas; -extern std::vector all_opers; -extern std::vector local_users; -extern userrec* fd_ref_table[65536]; -void cmd_rehash::Handle (char **parameters, int pcnt, userrec *user) +extern "C" command_t* init_command(InspIRCd* Instance) { - WriteServ(user->fd,"382 %s %s :Rehashing",user->nick,CleanFilename(CONFIG_FILE)); + return new cmd_rehash(Instance); +} + +CmdResult cmd_rehash::Handle (const char** parameters, int pcnt, userrec *user) +{ + user->WriteServ("382 %s %s :Rehashing",user->nick,ServerConfig::CleanFilename(CONFIG_FILE)); std::string parameter = ""; if (pcnt) { @@ -72,10 +36,11 @@ void cmd_rehash::Handle (char **parameters, int pcnt, userrec *user) } else { - WriteOpers("%s is rehashing config file %s",user->nick,CleanFilename(CONFIG_FILE)); - Config->Read(false,user); + ServerInstance->WriteOpers("%s is rehashing config file %s",user->nick,ServerConfig::CleanFilename(CONFIG_FILE)); + ServerInstance->Config->Read(false,user); } FOREACH_MOD(I_OnRehash,OnRehash(parameter)); -} + return CMD_SUCCESS; +}