QTfrontend/net/newnetclient.cpp
changeset 7732 fad3408fdcc1
parent 7731 262228c64f15
child 7736 1cf84a84ef43
equal deleted inserted replaced
7731:262228c64f15 7732:fad3408fdcc1
   241     }
   241     }
   242 
   242 
   243     if (lst[0] == "NICK")
   243     if (lst[0] == "NICK")
   244     {
   244     {
   245         mynick = lst[1];
   245         mynick = lst[1];
       
   246         m_playersModel->setNickname(mynick);
   246         return ;
   247         return ;
   247     }
   248     }
   248 
   249 
   249     if (lst[0] == "PROTO")
   250     if (lst[0] == "PROTO")
   250         return ;
   251         return ;
   444     if(lst[0] == "KICKED")
   445     if(lst[0] == "KICKED")
   445     {
   446     {
   446         netClientState = InLobby;
   447         netClientState = InLobby;
   447         askRoomsList();
   448         askRoomsList();
   448         emit LeftRoom(tr("You got kicked"));
   449         emit LeftRoom(tr("You got kicked"));
       
   450         m_playersModel->resetRoomFlags();
       
   451 
   449         return;
   452         return;
   450     }
   453     }
   451 
   454 
   452     if(lst[0] == "LOBBY:JOINED")
   455     if(lst[0] == "LOBBY:JOINED")
   453     {
   456     {
   460         for(int i = 1; i < lst.size(); ++i)
   463         for(int i = 1; i < lst.size(); ++i)
   461         {
   464         {
   462             if (lst[i] == mynick)
   465             if (lst[i] == mynick)
   463             {
   466             {
   464                 netClientState = InLobby;
   467                 netClientState = InLobby;
       
   468                 m_playersModel->resetRoomFlags();
   465                 RawSendNet(QString("LIST"));
   469                 RawSendNet(QString("LIST"));
   466                 emit connected();
   470                 emit connected();
   467             }
   471             }
   468 
   472 
   469             emit nickAddedLobby(lst[i], false);
   473             emit nickAddedLobby(lst[i], false);
   642 
   646 
   643         if(lst[0] == "ROOMABANDONED")
   647         if(lst[0] == "ROOMABANDONED")
   644         {
   648         {
   645             netClientState = InLobby;
   649             netClientState = InLobby;
   646             askRoomsList();
   650             askRoomsList();
       
   651             m_playersModel->resetRoomFlags();
   647             emit LeftRoom(tr("Room destroyed"));
   652             emit LeftRoom(tr("Room destroyed"));
   648             return;
   653             return;
   649         }
   654         }
   650 
   655 
   651         if (lst[0] == "RUN_GAME")
   656         if (lst[0] == "RUN_GAME")
   904 }
   909 }
   905 
   910 
   906 void HWNewNet::partRoom()
   911 void HWNewNet::partRoom()
   907 {
   912 {
   908     netClientState = InLobby;
   913     netClientState = InLobby;
       
   914     m_playersModel->resetRoomFlags();
   909     RawSendNet(QString("PART"));
   915     RawSendNet(QString("PART"));
   910     askRoomsList();
   916     askRoomsList();
   911 }
   917 }
   912 
   918 
   913 bool HWNewNet::isInRoom()
   919 bool HWNewNet::isInRoom()