]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_rehash.cpp
Made SANICK not collide the user (theres no need to in the new 1.1 now we have return...
[user/henk/code/inspircd.git] / src / cmd_rehash.cpp
index 16fe3e058f57055f929c2c3d31e819c013944a21..f53f810a49544ef94acfb3c2611a999af804940a 100644 (file)
@@ -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:
- *                <brain.net>
- *                <Craig.net>
+ *                <brain@chatspike.net>
+ *                <Craig@chatspike.net>
  *
  * Written by Craig Edwards, Craig McLure, and others.
  * This program is free but copyrighted software; see
  * ---------------------------------------------------
  */
 
-using namespace std;
-
-#include "inspircd_config.h"
-#include "inspircd.h"
-#include "inspircd_io.h"
-#include <time.h>
-#include <string>
-#ifdef GCC3
-#include <ext/hash_map>
-#else
-#include <hash_map>
-#endif
-#include <map>
-#include <sstream>
-#include <vector>
-#include <deque>
+#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<Module*> modules;
-extern std::vector<ircd_module*> factory;
-extern time_t TIME;
-extern user_hash clientlist;
-extern chan_hash chanlist;
-extern whowas_hash whowas;
-extern std::vector<userrec*> all_opers;
-extern std::vector<userrec*> 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;
+}