From: brain Date: Wed, 30 Nov 2005 15:35:15 +0000 (+0000) Subject: Added Server::RehashServer X-Git-Tag: v2.0.23~9964 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=5a331966832a930d4770752f5e60338581830887;p=user%2Fhenk%2Fcode%2Finspircd.git Added Server::RehashServer git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2060 e03df62e-2008-0410-955e-edbf42e46eb7 --- diff --git a/include/modules.h b/include/modules.h index 69f020754..dd141ae61 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1121,6 +1121,8 @@ class Server : public classbase /** Deletes a class derived from InspSocket from the server's socket engine. */ virtual void DelSocket(InspSocket* sock); + + virtual void RehashServer(); }; diff --git a/src/commands.cpp b/src/commands.cpp index 518ecd71e..82a6a2237 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -1076,7 +1076,10 @@ void handle_rehash(char **parameters, int pcnt, userrec *user) { WriteServ(user->fd,"382 %s %s :Rehashing",user->nick,CleanFilename(CONFIG_FILE)); ReadConfig(false,user); - FOREACH_MOD OnRehash(); + std::string parameter = ""; + if (pcnt) + parameter = parameters[0]; + FOREACH_MOD OnRehash(parameter); WriteOpers("%s is rehashing config file %s",user->nick,CleanFilename(CONFIG_FILE)); } diff --git a/src/inspircd.cpp b/src/inspircd.cpp index dd151283a..a946abbbb 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -293,7 +293,7 @@ void ReadConfig(bool bail, userrec* user) } else { - WriteOpers("There were errors in the configuration file:",user->nick); + WriteOpers("There were errors in the configuration file:"); while (!errstr.eof()) { errstr.getline(dataline,1024); diff --git a/src/modules.cpp b/src/modules.cpp index a1c9ca811..0541c266d 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -384,6 +384,12 @@ void Server::AddSocket(InspSocket* sock) module_sockets.push_back(sock); } +void Server::RehashServer() +{ + WriteOpers("*** Rehashing config file"); + ReadConfig(false,NULL); +} + void Server::DelSocket(InspSocket* sock) { for (std::vector::iterator a = module_sockets.begin(); a < module_sockets.end(); a++)