#include "commands/cmd_stats.h"
#include "socket.h"
#include "xline.h"
-#include "transport.h"
-
-#include "m_spanningtree/cachetimer.h"
-#include "m_spanningtree/resolvers.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/rconnect.h"
-#include "m_spanningtree/rsquit.h"
-#include "m_spanningtree/protocolinterface.h"
+#include "../transport.h"
+
+#include "cachetimer.h"
+#include "resolvers.h"
+#include "main.h"
+#include "utils.h"
+#include "treeserver.h"
+#include "link.h"
+#include "treesocket.h"
+#include "rconnect.h"
+#include "rsquit.h"
+#include "protocolinterface.h"
/* $ModDep: m_spanningtree/cachetimer.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 m_spanningtree/rconnect.h m_spanningtree/rsquit.h m_spanningtree/protocolinterface.h */
I_OnPreCommand, I_OnGetServerDescription, I_OnUserInvite, I_OnPostLocalTopicChange,
I_OnWallops, I_OnUserNotice, I_OnUserMessage, I_OnBackgroundTimer,
I_OnUserJoin, I_OnChangeLocalUserHost, I_OnChangeName, I_OnUserPart, I_OnUnloadModule,
- I_OnUserQuit, I_OnUserPostNick, I_OnUserKick, I_OnRemoteKill, I_OnRehash,
+ I_OnUserQuit, I_OnUserPostNick, I_OnUserKick, I_OnRemoteKill, I_OnRehash, I_OnPreRehash,
I_OnOper, I_OnAddLine, I_OnDelLine, I_ProtoSendMode, I_OnMode, I_OnLoadModule,
I_OnStats, I_ProtoSendMetaData, I_OnEvent, I_OnSetAway, I_OnPostCommand
};
- ServerInstance->Modules->Attach(eventlist, this, 29);
+ ServerInstance->Modules->Attach(eventlist, this, 30);
delete ServerInstance->PI;
ServerInstance->PI = new SpanningTreeProtocolInterface(this, Utils, ServerInstance);
void ModuleSpanningTree::OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent)
{
- if (loopCall)
- return;
- if ((source) && (IS_LOCAL(source)))
+ std::deque<std::string> params;
+ params.push_back(chan->name);
+ params.push_back(user->uuid);
+ params.push_back(":"+reason);
+ if (IS_LOCAL(source))
{
- std::deque<std::string> params;
- params.push_back(chan->name);
- params.push_back(user->uuid);
- params.push_back(":"+reason);
Utils->DoOneToMany(source->uuid,"KICK",params);
}
- else if (!source)
+ else if (IS_FAKE(source) && source != Utils->ServerUser)
{
- std::deque<std::string> params;
- params.push_back(chan->name);
- params.push_back(user->uuid);
- params.push_back(":"+reason);
Utils->DoOneToMany(ServerInstance->Config->GetSID(),"KICK",params);
}
}
Utils->DoOneToMany(source->uuid,"KILL",params);
}
-void ModuleSpanningTree::OnRehash(User* user, const std::string ¶meter)
+void ModuleSpanningTree::OnPreRehash(User* user, const std::string ¶meter)
{
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->DoOneToAllButSender(user ? user->uuid : ServerInstance->Config->GetSID(), "REHASH", params, user ? user->server : ServerInstance->Config->ServerName);
}
+}
+void ModuleSpanningTree::OnRehash(User* user)
+{
// Re-read config stuff
Utils->ReadConfiguration(true);
}
*/
void ModuleSpanningTree::Prioritize()
{
- ServerInstance->Modules->SetModulePriority(this, PRIORITY_LAST);
+ ServerInstance->Modules->SetPriority(this, PRIORITY_LAST);
}
MODULE_INIT(ModuleSpanningTree)