summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-09-23 12:44:42 +0100
committerPeter Powell <petpow@saberuk.com>2019-09-23 13:18:21 +0100
commit65f74be719bf249f4bc93e09670ee07410ecec96 (patch)
treede7cda47955ab4876db23ff3d59081bc6b85e720
parentcf5d382b822cecd54fdbc77e4c1c4de8a8aa3c35 (diff)
Add the OnServerBurst hook and fix the docs for OnServerLink.
-rw-r--r--include/modules/server.h9
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp1
2 files changed, 8 insertions, 2 deletions
diff --git a/include/modules/server.h b/include/modules/server.h
index c758df364..4e02efd19 100644
--- a/include/modules/server.h
+++ b/include/modules/server.h
@@ -61,11 +61,16 @@ class ServerProtocol::LinkEventListener
{
}
- /** Fired when a server finishes burst
- * @param server Server that recently linked and finished burst
+ /** Fired when a server has linked to the network.
+ * @param server Server that recently linked.
*/
virtual void OnServerLink(const Server* server) { }
+ /** Fired when a server has finished bursting.
+ * @param server Server that recently finished bursting.
+ */
+ virtual void OnServerBurst(const Server* server) { }
+
/** Fired when a server splits
* @param server Server that split
* @param error Whether the server split because of an error.
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp
index c463ef1c8..6fb6705ba 100644
--- a/src/modules/m_spanningtree/treeserver.cpp
+++ b/src/modules/m_spanningtree/treeserver.cpp
@@ -167,6 +167,7 @@ void TreeServer::FinishBurst()
unsigned long bursttime = ts - this->StartBurst;
ServerInstance->SNO->WriteToSnoMask(Parent == Utils->TreeRoot ? 'l' : 'L', "Received end of netburst from \002%s\002 (burst time: %lu %s)",
GetName().c_str(), (bursttime > 10000 ? bursttime / 1000 : bursttime), (bursttime > 10000 ? "secs" : "msecs"));
+ FOREACH_MOD_CUSTOM(Utils->Creator->GetLinkEventProvider(), ServerProtocol::LinkEventListener, OnServerBurst, (this));
StartBurst = 0;
FinishBurstInternal();