summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-10-17 19:11:25 +0100
committerPeter Powell <petpow@saberuk.com>2019-10-17 19:11:25 +0100
commit8c0912f428afc6340693f2c55ed82358e4a4579a (patch)
tree343f165286957d866d4a1ce6b9f374dc54bc2fd2 /src/modules/m_spanningtree
parente3deb783406e15cf496afab6971a908215b2ea81 (diff)
SQuit all servers when a shutdown happens.
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/main.cpp7
-rw-r--r--src/modules/m_spanningtree/main.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 3e992f39f..fbc6ad40c 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -793,6 +793,13 @@ void ModuleSpanningTree::OnMode(User* source, User* u, Channel* c, const Modes::
}
}
+void ModuleSpanningTree::OnShutdown(const std::string& reason)
+{
+ const TreeServer::ChildServers& children = Utils->TreeRoot->GetChildren();
+ while (!children.empty())
+ children.front()->SQuit(reason, true);
+}
+
CullResult ModuleSpanningTree::cull()
{
if (Utils)
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index bc31a9aea..3a61927b4 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -212,6 +212,7 @@ class ModuleSpanningTree
void OnUnloadModule(Module* mod) CXX11_OVERRIDE;
ModResult OnAcceptConnection(int newsock, ListenSocket* from, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server) CXX11_OVERRIDE;
void OnMode(User* source, User* u, Channel* c, const Modes::ChangeList& modes, ModeParser::ModeProcessFlag processflags) CXX11_OVERRIDE;
+ void OnShutdown(const std::string& reason) CXX11_OVERRIDE;
CullResult cull() CXX11_OVERRIDE;
~ModuleSpanningTree();
Version GetVersion() CXX11_OVERRIDE;