QTfrontend/net/newnetclient.cpp
changeset 15909 7409084d891f
parent 15908 014f4edd0421
child 15915 35d26863a88e
equal deleted inserted replaced
15908:014f4edd0421 15909:7409084d891f
   472                 emit roomChatMessage(sender, message);
   472                 emit roomChatMessage(sender, message);
   473         }
   473         }
   474         return;
   474         return;
   475     }
   475     }
   476 
   476 
       
   477     if (lst[0] == "MSG" || lst[0] == "MSG_ECHO")
       
   478     {
       
   479         if(lst.size() < 3)
       
   480         {
       
   481             qWarning("Net: Empty MSG message");
       
   482             return;
       
   483         }
       
   484 
       
   485         bool isEcho = lst[0] == "MSG_ECHO";
       
   486         QString nick = lst[1];
       
   487         QString message = lst[2];
       
   488 
       
   489         if (netClientState == InLobby)
       
   490         {
       
   491             emit lobbyDirectMessage(nick, message, isEcho);
       
   492         }
       
   493         else
       
   494         {
       
   495             emit chatStringFromNet(HWProto::formatDirectMsg(mynick, nick, message, isEcho));
       
   496             emit roomDirectMessage(nick, message, isEcho);
       
   497         }
       
   498         return;
       
   499     }
       
   500 
   477     if (netClientState == InRoom || netClientState == InGame || netClientState == InDemo)
   501     if (netClientState == InRoom || netClientState == InGame || netClientState == InDemo)
   478     {
   502     {
   479         if (lst[0] == "TEAMDRAW")
   503         if (lst[0] == "TEAMDRAW")
   480         {
   504         {
   481             if(lst.size() < 3)
   505             if(lst.size() < 3)
   482             {
   506             {
   483                 qWarning("Net: Empty CHAT message");
   507                 qWarning("Net: Empty TEAMDRAW message");
   484                 return;
   508                 return;
   485             }
   509             }
   486 
   510 
   487             QString action;
   511             QString action;
   488             QString message = lst[2];
   512             QString message = lst[2];