QTfrontend/net/newnetclient.cpp
changeset 7535 87e5838103ff
parent 7526 ff3a05e29ddd
child 7545 063601290761
--- a/QTfrontend/net/newnetclient.cpp	Mon Aug 13 21:07:28 2012 +0400
+++ b/QTfrontend/net/newnetclient.cpp	Mon Aug 13 23:04:42 2012 +0400
@@ -507,6 +507,30 @@
         return;
     }
 
+    if(netClientState == InLobby && lst[0] == "JOINED")
+    {
+        if(lst.size() < 2 || lst[1] != mynick)
+        {
+            qWarning("Net: Bad JOINED message");
+            return;
+        }
+
+        for(int i = 1; i < lst.size(); ++i)
+        {
+            if (lst[i] == mynick)
+            {
+                netClientState = InRoom;
+                emit EnteredGame();
+                emit roomMaster(isChief);
+                if (isChief)
+                    emit configAsked();
+            }
+
+            emit nickAdded(lst[i], isChief && (lst[i] != mynick));
+            emit chatStringFromNet(tr("%1 *** %2 has joined the room").arg('\x03').arg(lst[i]));
+        }
+        return;
+    }
 
     if(netClientState == InRoom)
     {
@@ -628,15 +652,6 @@
 
             for(int i = 1; i < lst.size(); ++i)
             {
-                if (lst[i] == mynick)
-                {
-                    netClientState = InRoom;
-                    emit EnteredGame();
-                    emit roomMaster(isChief);
-                    if (isChief)
-                        emit configAsked();
-                }
-
                 emit nickAdded(lst[i], isChief && (lst[i] != mynick));
                 emit chatStringFromNet(tr("%1 *** %2 has joined the room").arg('\x03').arg(lst[i]));
             }