X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcmd_rehash.cpp;h=7700d7f4960573f6e4bd946579b06c5536cdd98e;hb=6f4bf8ffd367f35b96265fea1ad01fb1acf2adcd;hp=693b8c99c8c700b380033de3b8500d2bb3329894;hpb=9826d2ee0a26234a4f5421ae686b0068f3f64c57;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cmd_rehash.cpp b/src/cmd_rehash.cpp index 693b8c99c..7700d7f49 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,68 +14,37 @@ * --------------------------------------------------- */ -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[MAX_DESCRIPTORS]; -void cmd_rehash::Handle (char **parameters, int pcnt, userrec *user) +extern "C" command_t* init_command(InspIRCd* Instance) +{ + return new cmd_rehash(Instance); +} + +CmdResult cmd_rehash::Handle (const char** parameters, int pcnt, userrec *user) { - WriteServ(user->fd,"382 %s %s :Rehashing",user->nick,CleanFilename(CONFIG_FILE)); + user->WriteServ("382 %s %s :Rehashing",user->nick,ServerConfig::CleanFilename(CONFIG_FILE)); std::string parameter = ""; + std::string old_disabled = ServerInstance->Config->DisabledCommands; if (pcnt) { parameter = parameters[0]; } 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); } + if (old_disabled != ServerInstance->Config->DisabledCommands) + InitializeDisabledCommands(ServerInstance->Config->DisabledCommands, ServerInstance); + FOREACH_MOD(I_OnRehash,OnRehash(parameter)); -} + return CMD_SUCCESS; +}