QTfrontend/newnetclient.cpp
changeset 5861 b102aa6a853e
parent 5390 f41e87de8989
child 5959 2e5182c5617a
equal deleted inserted replaced
5860:0141ab2ef67b 5861:b102aa6a853e
   494     if (lst[0] == "RUN_GAME") {
   494     if (lst[0] == "RUN_GAME") {
   495         netClientState = 5;
   495         netClientState = 5;
   496         emit AskForRunGame();
   496         emit AskForRunGame();
   497         return;
   497         return;
   498     }
   498     }
   499     
       
   500     if (lst[0] == "BYE") {
       
   501         if (lst[1] == "Authentication failed")
       
   502         {
       
   503             // Set the password blank if case the user tries to join and enter his password again
       
   504             config->setValue("net/passwordlength", 0);
       
   505             config->setNetPasswordLength(0);
       
   506         }
       
   507         // return early so the user won't get an unknown error message dialog (the user already gets a server connection is lost one)
       
   508         return;
       
   509     }
       
   510 
   499 
   511     if (lst[0] == "ASKPASSWORD") {
   500     if (lst[0] == "ASKPASSWORD") {
   512         bool ok = false;
   501         bool ok = false;
   513         int passLength = config->value("net/passwordlength", 0).toInt();
   502         int passLength = config->value("net/passwordlength", 0).toInt();
   514         QString hash = config->value("net/passwordhash", "").toString();
   503         QString hash = config->value("net/passwordhash", "").toString();
   623         if (lst.size() < 2)
   612         if (lst.size() < 2)
   624         {
   613         {
   625             qWarning("Net: Bad BYE message");
   614             qWarning("Net: Bad BYE message");
   626             return;
   615             return;
   627         }
   616         }
       
   617         if (lst[1] == "Authentication failed")
       
   618         {
       
   619             // Set the password blank if case the user tries to join and enter his password again
       
   620             config->setValue("net/passwordlength", 0);
       
   621             config->setNetPasswordLength(0);
       
   622         }
   628         emit showMessage(HWNewNet::tr("Quit reason: ") + lst[1]);
   623         emit showMessage(HWNewNet::tr("Quit reason: ") + lst[1]);
   629         return;
   624         return;
   630     }
   625     }
   631 
   626 
   632 
   627