this->Instance->SNO->WriteToSnoMask('l',"Server \2"+servername+"\2 being introduced from \2" + prefix + "\2 denied, already exists. Closing link with " + prefix);
return false;
}
+
Link* lnk = Utils->FindLink(servername);
- TreeServer* Node = new TreeServer(this->Utils,this->Instance,servername,description,ParentOfThis,NULL, lnk ? lnk->Hidden : false);
+
+ TreeServer *Node = new TreeServer(this->Utils, this->Instance, servername, description, sid, ParentOfThis,NULL, lnk ? lnk->Hidden : false);
+
+ 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);
+ return false;
+ }
+
ParentOfThis->AddChild(Node);
- Node->SetID(sid);
params[4] = ":" + params[4];
Utils->SetRemoteBursting(Node, true);
Utils->DoOneToAllButSender(prefix,"SERVER",params,prefix);
// we should add the details of this server now
// to the servers tree, as a child of the root
// node.
- TreeServer* Node = new TreeServer(this->Utils,this->Instance,sname,description,Utils->TreeRoot,this,x->Hidden);
+
+ TreeServer *Node = new TreeServer(this->Utils, this->Instance, sname, description, sid, Utils->TreeRoot, this, x->Hidden);
+
+ if (Node->DuplicateID())
+ {
+ this->SendError("Server ID "+sid+" already exists on the network!");
+ this->Instance->SNO->WriteToSnoMask('l',"Server \2"+assign(servername)+"\2 being introduced denied, server ID already exists on the network. Closing link.");
+ return false;
+ }
+
Utils->TreeRoot->AddChild(Node);
params[4] = ":" + params[4];
- Node->SetID(params[3]);
Utils->DoOneToAllButSender(Utils->TreeRoot->GetName(),"SERVER",params,sname);
this->bursting = true;
this->DoBurst(Node);
CheckDupeSocket->Close();
return false;
}
- /* Now check for fully initialized instances of the server */
+ /* Check for fully initialized instances of the server by id */
+ Instance->Log(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->LinkState = CONNECTED;
Link* lnk = Utils->FindLink(InboundServerName);
- Node = new TreeServer(this->Utils,this->Instance, InboundServerName, InboundDescription, Utils->TreeRoot, this, lnk ? lnk->Hidden : false);
+
+ Node = new TreeServer(this->Utils,this->Instance, InboundServerName, InboundDescription, InboundSID, Utils->TreeRoot, this, lnk ? lnk->Hidden : false);
+
+ if (Node->DuplicateID())
+ {
+ this->SendError("Server ID "+InboundSID+" already exists on the network!");
+ this->Instance->SNO->WriteToSnoMask('l',"Server \2"+InboundServerName+"\2 being introduced from \2" + prefix + "\2 denied, server ID already exists on the network. Closing link.");
+ return false;
+ }
Utils->DelBurstingServer(this);
Utils->TreeRoot->AddChild(Node);
params.clear();
params.push_back("1");
params.push_back(InboundSID);
params.push_back(":"+InboundDescription);
- Node->SetID(InboundSID);
Utils->DoOneToAllButSender(Utils->TreeRoot->GetName(),"SERVER",params,InboundServerName);
this->bursting = true;
this->DoBurst(Node);
const char* modelist[MAXPARAMETERS];
for (size_t i = 0; i < params.size(); i++)
modelist[i] = params[i].c_str();
- userrec* fake = new userrec(Instance);
- fake->SetFd(FD_MAGIC_NUMBER);
- this->Instance->SendMode(modelist, params.size(), fake);
-
- delete fake;
+ this->Instance->SendMode(modelist, params.size(), this->Instance->FakeClient);
/* Hot potato! pass it on! */
return Utils->DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params);
}
userrec* x = this->Instance->FindNick(params[0]);
if ((x) && (x != who))
{
+ /* x is local, who is remote */
+ this->DoCollision(x, who->age, who->ident, who->GetIPString(), who->uuid);
+ return true;
+/*
+Old nickname collision logic..
std::deque<std::string> p;
p.push_back(params[0]);
p.push_back(":Nickname collision ("+prefix+" -> "+params[0]+")");
userrec::QuitUser(this->Instance,y,"Nickname collision");
}
return Utils->DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params);
+*/
}
}
// its a user