diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-07-28 14:30:14 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-07-28 14:30:14 +0200 |
commit | 5214968e7e0e0d43e137535ac1a9369c222d79f0 (patch) | |
tree | ff06c606ce82c73fd75587af9110b5954a260d3f /src/modules/m_spanningtree/treeserver.h | |
parent | 91ba5c22664cae39d53f52af663a154286455e01 (diff) |
m_spanningtree Move squit logic into TreeServer from TreeSocket
Diffstat (limited to 'src/modules/m_spanningtree/treeserver.h')
-rw-r--r-- | src/modules/m_spanningtree/treeserver.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/treeserver.h b/src/modules/m_spanningtree/treeserver.h index 3f1f0755d..2e6c47bf4 100644 --- a/src/modules/m_spanningtree/treeserver.h +++ b/src/modules/m_spanningtree/treeserver.h @@ -65,6 +65,10 @@ class TreeServer : public Server */ void AddHashEntry(); + /** Used by SQuit logic to recursively remove servers + */ + void SQuitInternal(const std::string& reason, int& num_lost_servers, int& num_lost_users); + public: typedef std::vector<TreeServer*> ChildServers; FakeUser* const ServerUser; /* User representing this server */ @@ -87,6 +91,20 @@ class TreeServer : public Server */ TreeServer(const std::string& Name, const std::string& Desc, const std::string& id, TreeServer* Above, TreeSocket* Sock, bool Hide); + /** SQuit a server connected to this server, removing the given server and all servers behind it + * @param server Server to squit, must be directly below this server + * @param reason Reason for quitting the server, sent to opers and other servers + */ + void SQuitChild(TreeServer* server, const std::string& reason); + + /** SQuit this server, removing this server and all servers behind it + * @param reason Reason for quitting the server, sent to opers and other servers + */ + void SQuit(const std::string& reason) + { + GetParent()->SQuitChild(this, reason); + } + int QuitUsers(const std::string &reason); /** Get route. |