diff options
Diffstat (limited to 'src/modules/m_spanningtree/treeserver.cpp')
-rw-r--r-- | src/modules/m_spanningtree/treeserver.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index d252f2386..5f91e43b5 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -132,6 +132,11 @@ std::string& TreeServer::GetID() void TreeServer::SetID(const std::string &id) { sid = id; + server_hash::iterator iter = Utils->sidlist.find(sid); + if (iter == Utils->sidlist.end()) + Utils->sidlist[sid] = this; + else + throw CoreException("Server ID '"+id+"' already exists!"); } int TreeServer::QuitUsers(const std::string &reason) @@ -330,6 +335,10 @@ TreeServer::~TreeServer() { /* We'd better tidy up after ourselves, eh? */ this->DelHashEntry(); + + server_hash::iterator iter = Utils->sidlist.find(GetID()); + if (iter != Utils->sidlist.end()) + Utils->sidlist.erase(iter); } |