summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-08 15:00:28 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-08 15:00:28 +0000
commit94ab2b6eb5c8d719da0d9b72bc74ee29017d7995 (patch)
tree887e329ba879c4a674d8570f94c906644aeeef37 /src/modules/m_spanningtree
parent395a610c2cf3d3712962e2048cde7244ed16e765 (diff)
Remote REHASH stuff, this drove me nuts but should probably work now.. thx brain
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9423 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/main.cpp17
-rw-r--r--src/modules/m_spanningtree/rehash.cpp48
-rw-r--r--src/modules/m_spanningtree/treesocket.h4
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp4
4 files changed, 8 insertions, 65 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 92df0c468..102fc4b13 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -741,20 +741,19 @@ void ModuleSpanningTree::OnRemoteKill(User* source, User* dest, const std::strin
void ModuleSpanningTree::OnRehash(User* user, const std::string &parameter)
{
- if (!parameter.empty())
+ ServerInstance->Logs->Log("remoterehash", DEBUG, "called with param %s", parameter.c_str());
+
+ // Send out to other servers
+ if (!parameter.empty() && parameter[0] != '-')
{
+ ServerInstance->Logs->Log("remoterehash", DEBUG, "sending out lol");
std::deque<std::string> params;
params.push_back(parameter);
- Utils->DoOneToMany(user ? user->nick : ServerInstance->Config->GetSID(), "REHASH", params);
- // check for self
- if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameter))
- {
- ServerInstance->SNO->WriteToSnoMask('A', "Remote rehash initiated locally by \002%s\002", user ? user->nick : ServerInstance->Config->ServerName);
- ServerInstance->RehashServer();
- }
+ Utils->DoOneToAllButSender(user ? user->uuid : ServerInstance->Config->GetSID(), "REHASH", params, user ? user->server : ServerInstance->Config->GetSID()); /// Can this take SID?
}
+
+ // Re-read config stuff
Utils->ReadConfiguration(true);
- InitializeDisabledCommands(ServerInstance->Config->DisabledCommands, ServerInstance);
}
// note: the protocol does not allow direct umode +o except
diff --git a/src/modules/m_spanningtree/rehash.cpp b/src/modules/m_spanningtree/rehash.cpp
deleted file mode 100644
index 6707b897a..000000000
--- a/src/modules/m_spanningtree/rehash.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/* +------------------------------------+
- * | Inspire Internet Relay Chat Daemon |
- * +------------------------------------+
- *
- * InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
- *
- * This program is free but copyrighted software; see
- * the file COPYING for details.
- *
- * ---------------------------------------------------
- */
-
-#include "inspircd.h"
-#include "commands/cmd_whois.h"
-#include "commands/cmd_stats.h"
-#include "socket.h"
-#include "wildcard.h"
-#include "xline.h"
-#include "transport.h"
-#include "socketengine.h"
-
-#include "m_spanningtree/main.h"
-#include "m_spanningtree/utils.h"
-#include "m_spanningtree/treeserver.h"
-#include "m_spanningtree/link.h"
-#include "m_spanningtree/treesocket.h"
-#include "m_spanningtree/resolvers.h"
-#include "m_spanningtree/handshaketimer.h"
-
-/* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h */
-
-bool TreeSocket::RemoteRehash(const std::string &prefix, std::deque<std::string> &params)
-{
- if (params.size() < 1)
- return false;
-
- std::string servermask = params[0];
-
- if (this->Instance->MatchText(this->Instance->Config->ServerName,servermask))
- {
- this->Instance->SNO->WriteToSnoMask('l',"Remote rehash initiated by \002"+prefix+"\002.");
- this->Instance->RehashServer();
- }
- Utils->DoOneToAllButSender(prefix,"REHASH",params,prefix);
- return true;
-}
-
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h
index a33e33c88..324203f11 100644
--- a/src/modules/m_spanningtree/treesocket.h
+++ b/src/modules/m_spanningtree/treesocket.h
@@ -312,10 +312,6 @@ class TreeSocket : public BufferedSocket
*/
bool ServicePart(const std::string &prefix, std::deque<std::string> &params);
- /** REHASH
- */
- bool RemoteRehash(const std::string &prefix, std::deque<std::string> &params);
-
/** KILL
*/
bool RemoteKill(const std::string &prefix, std::deque<std::string> &params);
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index c99402af0..aa7d2b2af 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -392,10 +392,6 @@ bool TreeSocket::ProcessLine(std::string &line)
{
return this->ForceTopic(prefix,params);
}
- else if (command == "REHASH")
- {
- return this->RemoteRehash(prefix,params);
- }
else if (command == "METADATA")
{
return this->MetaData(prefix,params);