X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Ftreesocket1.cpp;h=c9729cc0f3a6837c96d3d290b1e44c0ad8e9887b;hb=a785f350fd584d87f3b84bbaff569ecb59c29f04;hp=3e916544bfbadc1ddf7cbd628faa12ce768a332b;hpb=46d3b5e9fc806924c1025b273c9138d452f659f7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 3e916544b..c9729cc0f 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -157,8 +157,9 @@ void TreeSocket::SendError(const std::string &errormessage) */ void TreeSocket::SquitServer(std::string &from, TreeServer* Current, int& num_lost_servers, int& num_lost_users) { + std::string servername = Current->GetName(); ServerInstance->Logs->Log("m_spanningtree",DEBUG,"SquitServer for %s from %s", - Current->GetName().c_str(), from.c_str()); + servername.c_str(), from.c_str()); /* recursively squit the servers attached to 'Current'. * We're going backwards so we don't remove users * while we still need them ;) @@ -188,9 +189,9 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason) if (!Current->GetSocket() || Current->GetSocket()->Introduced()) { parameterlist params; - params.push_back(Current->GetName()); + params.push_back(Current->GetID()); params.push_back(":"+reason); - Utils->DoOneToAllButSender(Current->GetParent()->GetName(),"SQUIT",params,Current->GetName()); + Utils->DoOneToAllButSender(Current->GetParent()->GetID(),"SQUIT",params,Current->GetID()); } if (Current->GetParent() == Utils->TreeRoot) @@ -200,7 +201,7 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason) } else { - ServerInstance->SNO->WriteGlobalSno('L', "Server \002"+Current->GetName()+"\002 split from server \002"+Current->GetParent()->GetName()+"\002 with reason: "+reason); + ServerInstance->SNO->WriteToSnoMask('L', "Server \002"+Current->GetName()+"\002 split from server \002"+Current->GetParent()->GetName()+"\002 with reason: "+reason); } int num_lost_servers = 0; int num_lost_users = 0; @@ -211,8 +212,9 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason) Current->Tidy(); Current->GetParent()->DelChild(Current); Current->cull(); + const bool ismyroot = (Current == MyRoot); delete Current; - if (Current == MyRoot) + if (ismyroot) { MyRoot = NULL; Close();