]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket2.cpp
Merge insp20
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket2.cpp
index cd9afac419fafa1775fc369eb2c23137e7273202..fdd28a73425b0fd32709b2b5230ada19b45b4555 100644 (file)
@@ -160,9 +160,21 @@ void TreeSocket::ProcessLine(std::string &line)
                                                ServerInstance->SNO->WriteGlobalSno('l',"\2WARNING\2: Your clocks are out by %d seconds. Please consider synching your clocks.", abs((long)delta));
                                        }
                                }
+
+                               // Check for duplicate server name/sid again, it's possible that a new
+                               // server was introduced while we were waiting for them to send BURST.
+                               // (we do not reserve their server name/sid when they send SERVER, we do it now)
+                               if (!CheckDuplicate(capab->name, capab->sid))
+                                       return;
+
                                this->LinkState = CONNECTED;
                                Utils->timeoutlist.erase(this);
 
+                               linkID = capab->name;
+
+                               MyRoot = new TreeServer(Utils, capab->name, capab->description, capab->sid, Utils->TreeRoot, this, capab->hidden);
+                               Utils->TreeRoot->AddChild(MyRoot);
+
                                MyRoot->bursting = true;
                                this->DoBurst(MyRoot);
 
@@ -241,7 +253,7 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
                         * crossing the users QUIT further upstream from the server. Thanks jilles!
                         */
 
-                       if ((prefix.length() == UUID_LENGTH-1) && (isdigit(prefix[0])) &&
+                       if ((prefix.length() == UIDGenerator::UUID_LENGTH) && (isdigit(prefix[0])) &&
                                ((command == "FMODE") || (command == "MODE") || (command == "KICK") || (command == "TOPIC") || (command == "KILL") || (command == "ADDLINE") || (command == "DELLINE")))
                        {
                                /* Special case, we cannot drop these commands as they've been committed already on a
@@ -298,6 +310,12 @@ void TreeSocket::ProcessConnectedLine(std::string& prefix, std::string& command,
        if (command == "SVSMODE") // This isn't in an "else if" so we still force FMODE for changes on channels.
                command = "MODE";
 
+       if (proto_version < ProtocolVersion)
+       {
+               if (!PreProcessOldProtocolMessage(who, command, params))
+                       return;
+       }
+
        // TODO move all this into Commands
        if (command == "MAP")
        {