fix for disconnect reason not being shown
authorsheepluva
Sun, 11 Sep 2011 18:57:54 +0200
changeset 5861 b102aa6a853e
parent 5860 0141ab2ef67b
child 5862 b4229b0abc70
fix for disconnect reason not being shown
QTfrontend/newnetclient.cpp
--- a/QTfrontend/newnetclient.cpp	Sun Sep 11 18:37:34 2011 +0200
+++ b/QTfrontend/newnetclient.cpp	Sun Sep 11 18:57:54 2011 +0200
@@ -496,17 +496,6 @@
         emit AskForRunGame();
         return;
     }
-    
-    if (lst[0] == "BYE") {
-        if (lst[1] == "Authentication failed")
-        {
-            // Set the password blank if case the user tries to join and enter his password again
-            config->setValue("net/passwordlength", 0);
-            config->setNetPasswordLength(0);
-        }
-        // return early so the user won't get an unknown error message dialog (the user already gets a server connection is lost one)
-        return;
-    }
 
     if (lst[0] == "ASKPASSWORD") {
         bool ok = false;
@@ -625,6 +614,12 @@
             qWarning("Net: Bad BYE message");
             return;
         }
+        if (lst[1] == "Authentication failed")
+        {
+            // Set the password blank if case the user tries to join and enter his password again
+            config->setValue("net/passwordlength", 0);
+            config->setNetPasswordLength(0);
+        }
         emit showMessage(HWNewNet::tr("Quit reason: ") + lst[1]);
         return;
     }