From cf1aa8c36d1349e26020f7041ea027ada4b50ba4 Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 7 Apr 2008 16:50:20 +0000 Subject: Use server names for introduction of servers, not SIDs git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9401 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/server.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/server.cpp b/src/modules/m_spanningtree/server.cpp index 5213729a7..02e1a364b 100644 --- a/src/modules/m_spanningtree/server.cpp +++ b/src/modules/m_spanningtree/server.cpp @@ -48,9 +48,10 @@ bool TreeSocket::RemoteServer(const std::string &prefix, std::deque std::string sid = params[3]; std::string description = params[4]; TreeServer* ParentOfThis = Utils->FindServer(prefix); + if (!ParentOfThis) { - this->SendError("Protocol error - Introduced remote server from unknown server "+prefix); + this->SendError("Protocol error - Introduced remote server from unknown server "+ParentOfThis->GetName()); return false; } if (!this->Instance->IsSID(sid)) @@ -61,8 +62,8 @@ bool TreeSocket::RemoteServer(const std::string &prefix, std::deque TreeServer* CheckDupe = Utils->FindServer(servername); if (CheckDupe) { - this->SendError("Server "+servername+" already exists!"); - this->Instance->SNO->WriteToSnoMask('l',"Server \2"+servername+"\2 being introduced from \2" + prefix + "\2 denied, already exists. Closing link with " + prefix); + this->SendError("Server "+CheckDupe->GetName()+" already exists!"); + this->Instance->SNO->WriteToSnoMask('l',"Server \2"+CheckDupe->GetName()+"\2 being introduced from \2" + ParentOfThis->GetName() + "\2 denied, already exists. Closing link with " + ParentOfThis->GetName()); return false; } @@ -72,15 +73,15 @@ bool TreeSocket::RemoteServer(const std::string &prefix, std::deque if (Node->DuplicateID()) { - this->SendError("Server ID "+sid+" already exists on the network!"); - this->Instance->SNO->WriteToSnoMask('l',"Server \2"+servername+"\2 being introduced from \2" + prefix + "\2 denied, server ID already exists on the network. Closing link with " + prefix); + this->SendError("Server ID "+servername+" already exists on the network!"); + this->Instance->SNO->WriteToSnoMask('l',"Server \2"+servername+"\2 being introduced from \2" + ParentOfThis->GetName() + "\2 denied, server ID already exists on the network. Closing link with " + ParentOfThis->GetName()); return false; } ParentOfThis->AddChild(Node); params[4] = ":" + params[4]; Utils->DoOneToAllButSender(prefix,"SERVER",params,prefix); - this->Instance->SNO->WriteToSnoMask('l',"Server \002"+prefix+"\002 introduced server \002"+servername+"\002 ("+description+")"); + this->Instance->SNO->WriteToSnoMask('l',"Server \002"+ParentOfThis->GetName()+"\002 introduced server \002"+servername+"\002 ("+description+")"); return true; } -- cgit v1.2.3