QTfrontend/net/newnetclient.cpp
branchflibqtfrontend
changeset 8304 620560c89284
parent 8208 171da01bd04d
parent 8303 6331bceac95c
--- a/QTfrontend/net/newnetclient.cpp	Sun Dec 16 12:05:32 2012 +0400
+++ b/QTfrontend/net/newnetclient.cpp	Sun Dec 16 12:25:13 2012 +0400
@@ -241,6 +241,7 @@
     {
         mynick = lst[1];
         m_playersModel->setNickname(mynick);
+        m_nick_registered = false;
         return ;
     }
 
@@ -304,6 +305,10 @@
         QStringList tmp = lst;
         tmp.removeFirst();
         m_roomsListModel->setRoomsList(tmp);
+        if (m_nick_registered == false)
+        {
+            emit NickNotRegistered(mynick);
+        }
         return;
     }
 
@@ -538,7 +543,8 @@
 
     if (lst[0] == "ASKPASSWORD")
     {
-        emit AskForPassword(mynick);
+        emit NickRegistered(mynick);
+        m_nick_registered = true;
         return;
     }
 
@@ -573,6 +579,10 @@
         if (lst[1] == "Authentication failed")
         {
             emit AuthFailed();
+	    m_game_connected = false;
+	    Disconnect();
+	    //omitted 'emit disconnected()', we don't want the error message
+	    return;
         }
         m_game_connected = false;
         Disconnect();
@@ -629,6 +639,12 @@
             return;
         }
 
+        if (lst[0] == "ROUND_FINISHED")
+        {
+            emit FromNet(QByteArray("\x01o"));
+            return;
+        }
+
         if (lst[0] == "ADD_TEAM")
         {
             if(lst.size() != 24)