QTfrontend/net/newnetclient.cpp
changeset 8401 87410ae372f6
parent 8396 5123eac2f9d6
child 8416 e691acd778f5
equal deleted inserted replaced
8400:33ab77c0b486 8401:87410ae372f6
    26 #include "newnetclient.h"
    26 #include "newnetclient.h"
    27 #include "proto.h"
    27 #include "proto.h"
    28 #include "game.h"
    28 #include "game.h"
    29 #include "roomslistmodel.h"
    29 #include "roomslistmodel.h"
    30 #include "playerslistmodel.h"
    30 #include "playerslistmodel.h"
       
    31 #include "servermessages.h"
       
    32 #include "HWApplication.h"
    31 
    33 
    32 char delimeter='\n';
    34 char delimeter='\n';
    33 
    35 
    34 HWNewNet::HWNewNet() :
    36 HWNewNet::HWNewNet() :
    35     isChief(false),
    37     isChief(false),
   249         return ;
   251         return ;
   250 
   252 
   251     if (lst[0] == "ERROR")
   253     if (lst[0] == "ERROR")
   252     {
   254     {
   253         if (lst.size() == 2)
   255         if (lst.size() == 2)
   254             emit Error(lst[1]);
   256             emit Error(HWApplication::translate("server", lst[1].toAscii().constData()));
   255         else
   257         else
   256             emit Error("Unknown error");
   258             emit Error("Unknown error");
   257         return;
   259         return;
   258     }
   260     }
   259 
   261 
   260     if (lst[0] == "WARNING")
   262     if (lst[0] == "WARNING")
   261     {
   263     {
   262         if (lst.size() == 2)
   264         if (lst.size() == 2)
   263             emit Warning(lst[1]);
   265             emit Warning(HWApplication::translate("server", lst[1].toAscii().constData()));
   264         else
   266         else
   265             emit Warning("Unknown warning");
   267             emit Warning("Unknown warning");
   266         return;
   268         return;
   267     }
   269     }
   268 
   270 
   577             return;
   579             return;
   578         }
   580         }
   579         if (lst[1] == "Authentication failed")
   581         if (lst[1] == "Authentication failed")
   580         {
   582         {
   581             emit AuthFailed();
   583             emit AuthFailed();
   582 	    m_game_connected = false;
   584             m_game_connected = false;
   583 	    Disconnect();
   585             Disconnect();
   584 	    //omitted 'emit disconnected()', we don't want the error message
   586             //omitted 'emit disconnected()', we don't want the error message
   585 	    return;
   587             return;
   586         }
   588         }
   587         m_game_connected = false;
   589         m_game_connected = false;
   588         Disconnect();
   590         Disconnect();
   589         emit disconnected(lst[1]);
   591         emit disconnected(HWApplication::translate("server", lst[1].toAscii().constData()));
   590         return;
   592         return;
   591     }
   593     }
   592 
   594 
   593     if (lst[0] == "ADMIN_ACCESS")
   595     if (lst[0] == "ADMIN_ACCESS")
   594     {
   596     {