- /* Check for fully initialized instances of the server by id */
- Instance->Logs->Log("m_spanningtree",DEBUG,"Looking for dupe SID %s", sid.c_str());
- TreeServer* CheckDupeSID = Utils->FindServerID(sid);
- if (CheckDupeSID)
- {
- this->SendError("Server ID "+CheckDupeSID->GetID()+" already exists on server "+CheckDupeSID->GetName()+"!");
- this->Instance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, server ID '"+CheckDupeSID->GetID()+
- "' already exists on server "+CheckDupeSID->GetName());
- return false;
- }
- /* Now check for fully initialized instances of the server by name */
- TreeServer* CheckDupe = Utils->FindServer(sname);
- if (CheckDupe)
- {
- this->SendError("Server "+sname+" already exists on server "+CheckDupe->GetParent()->GetName()+"!");
- this->Instance->SNO->WriteToSnoMask('l',"Server connection from \2"+sname+"\2 denied, already exists on server "+CheckDupe->GetParent()->GetName());
- return false;
- }
- this->Instance->SNO->WriteToSnoMask('l',"Verified incoming server connection from \002"+sname+"\002["+(x->HiddenFromStats ? "<hidden>" : this->GetIP())+"] ("+description+")");
- if (this->Hook)
- {
- std::string name = BufferedSocketNameRequest((Module*)Utils->Creator, this->Hook).Send();
- this->Instance->SNO->WriteToSnoMask('l',"Connection from \2"+sname+"\2["+(x->HiddenFromStats ? "<hidden>" : this->GetIP())+"] using transport \2"+name+"\2");
- }
-
- // this is good. Send our details: Our server name and description and hopcount of 0,
- // along with the sendpass from this block.
- this->SendCapabilities();
- this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(x->SendPass, this->GetTheirChallenge())+" 0 "+Instance->Config->GetSID()+" :"+this->Instance->Config->ServerDesc);
- // move to the next state, we are now waiting for THEM.
- this->LinkState = WAIT_AUTH_2;
- return true;