Add the OnServerBurst hook and fix the docs for OnServerLink.

This commit is contained in:
Peter Powell 2019-09-23 12:44:42 +01:00
parent cf5d382b82
commit 65f74be719
2 changed files with 8 additions and 2 deletions

View File

@ -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.

View File

@ -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();