summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-02-12 16:54:34 +0100
committerAttila Molnar <attilamolnar@hush.com>2015-02-12 16:54:34 +0100
commit97e2deac07fbc55d383a9d618cf9d30b9a9136d9 (patch)
tree746894a7ed1d1d01ef286b5d5e3f0b9b4643736a
parentae6967b8b30ebc956e3158127ecba5d01dc09204 (diff)
m_spanningtree Pass Server* to the OnServerLink/OnServerSplit events
-rw-r--r--include/modules/spanningtree.h4
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/include/modules/spanningtree.h b/include/modules/spanningtree.h
index 0f51c35db..e71cdf9d0 100644
--- a/include/modules/spanningtree.h
+++ b/include/modules/spanningtree.h
@@ -32,10 +32,10 @@ class SpanningTreeEventListener : public Events::ModuleEventListener
/** Fired when a server finishes burst
* @param server Server that recently linked and finished burst
*/
- virtual void OnServerLink(const std::string& server) { }
+ virtual void OnServerLink(const Server* server) { }
/** Fired when a server splits
* @param server Server that split
*/
- virtual void OnServerSplit(const std::string& server) { }
+ virtual void OnServerSplit(const Server* server) { }
};
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp
index 6ebce07f9..d0c6401cd 100644
--- a/src/modules/m_spanningtree/treeserver.cpp
+++ b/src/modules/m_spanningtree/treeserver.cpp
@@ -151,7 +151,7 @@ void TreeServer::FinishBurst()
unsigned long bursttime = ts - this->StartBurst;
ServerInstance->SNO->WriteToSnoMask(Parent == Utils->TreeRoot ? 'l' : 'L', "Received end of netburst from \2%s\2 (burst time: %lu %s)",
GetName().c_str(), (bursttime > 10000 ? bursttime / 1000 : bursttime), (bursttime > 10000 ? "secs" : "msecs"));
- FOREACH_MOD_CUSTOM(Utils->Creator->GetEventProvider(), SpanningTreeEventListener, OnServerLink, (GetName()));
+ FOREACH_MOD_CUSTOM(Utils->Creator->GetEventProvider(), SpanningTreeEventListener, OnServerLink, (this));
StartBurst = 0;
FinishBurstInternal();
@@ -159,7 +159,7 @@ void TreeServer::FinishBurst()
void TreeServer::SQuitChild(TreeServer* server, const std::string& reason)
{
- FOREACH_MOD_CUSTOM(Utils->Creator->GetEventProvider(), SpanningTreeEventListener, OnServerSplit, (server->GetName()));
+ FOREACH_MOD_CUSTOM(Utils->Creator->GetEventProvider(), SpanningTreeEventListener, OnServerSplit, (server));
stdalgo::erase(Children, server);
if (IsRoot())