2005-12-16 18:10:38 +00:00
|
|
|
/* +------------------------------------+
|
|
|
|
* | Inspire Internet Relay Chat Daemon |
|
|
|
|
* +------------------------------------+
|
|
|
|
*
|
2006-01-15 15:59:11 +00:00
|
|
|
* InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
|
2005-12-16 18:10:38 +00:00
|
|
|
* E-mail:
|
2006-01-15 15:59:11 +00:00
|
|
|
* <brain@chatspike.net>
|
|
|
|
* <Craig@chatspike.net>
|
2005-12-16 18:10:38 +00:00
|
|
|
*
|
|
|
|
* Written by Craig Edwards, Craig McLure, and others.
|
|
|
|
* This program is free but copyrighted software; see
|
|
|
|
* the file COPYING for details.
|
|
|
|
*
|
|
|
|
* ---------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2006-04-08 17:05:48 +00:00
|
|
|
#include "configreader.h"
|
2005-12-16 18:10:38 +00:00
|
|
|
#include "users.h"
|
|
|
|
#include "modules.h"
|
2006-04-20 18:55:46 +00:00
|
|
|
#include "commands/cmd_rehash.h"
|
2005-12-16 18:10:38 +00:00
|
|
|
|
2006-09-03 00:09:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
extern "C" command_t* init_command(InspIRCd* Instance)
|
|
|
|
{
|
|
|
|
return new cmd_rehash(Instance);
|
|
|
|
}
|
|
|
|
|
2006-09-06 17:21:59 +00:00
|
|
|
CmdResult cmd_rehash::Handle (const char** parameters, int pcnt, userrec *user)
|
2005-12-16 18:10:38 +00:00
|
|
|
{
|
2006-08-10 18:28:37 +00:00
|
|
|
user->WriteServ("382 %s %s :Rehashing",user->nick,ServerConfig::CleanFilename(CONFIG_FILE));
|
2005-12-16 18:10:38 +00:00
|
|
|
std::string parameter = "";
|
|
|
|
if (pcnt)
|
|
|
|
{
|
|
|
|
parameter = parameters[0];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-08-10 18:28:37 +00:00
|
|
|
ServerInstance->WriteOpers("%s is rehashing config file %s",user->nick,ServerConfig::CleanFilename(CONFIG_FILE));
|
2006-08-09 11:33:10 +00:00
|
|
|
ServerInstance->Config->Read(false,user);
|
2005-12-16 18:10:38 +00:00
|
|
|
}
|
2006-10-02 00:22:52 +00:00
|
|
|
InitializeDisabledCommands(ServerInstance->Config->DisabledCommands, ServerInstance);
|
2005-12-26 17:26:16 +00:00
|
|
|
FOREACH_MOD(I_OnRehash,OnRehash(parameter));
|
2006-09-06 17:21:59 +00:00
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
2005-12-16 18:10:38 +00:00
|
|
|
}
|
2006-09-06 17:21:59 +00:00
|
|
|
|