QTfrontend/net/newnetclient.cpp
changeset 15908 014f4edd0421
parent 15900 fc3cb23fd26f
child 15909 7409084d891f
--- a/QTfrontend/net/newnetclient.cpp	Thu Oct 06 20:58:54 2022 +0300
+++ b/QTfrontend/net/newnetclient.cpp	Sun Oct 16 13:14:16 2022 +0300
@@ -474,6 +474,29 @@
         return;
     }
 
+    if (netClientState == InRoom || netClientState == InGame || netClientState == InDemo)
+    {
+        if (lst[0] == "TEAMDRAW")
+        {
+            if(lst.size() < 3)
+            {
+                qWarning("Net: Empty CHAT message");
+                return;
+            }
+
+            QString action;
+            QString message = lst[2];
+            QByteArray sender = lst[1].toUtf8();
+
+            QByteArray em("Ou");
+            em.append(sender.size());
+            em.append(sender);
+            em.append(QByteArray::fromBase64(message.toLatin1()));
+            emit FromNet(em.prepend(em.size()));
+            return;
+        }
+    }
+
     if (lst[0] == "INFO")
     {
         if(lst.size() < 5)
@@ -1046,6 +1069,12 @@
     RawSendNet(QString("TEAMCHAT") + delimiter + str);
 }
 
+void HWNewNet::SendDrawCmd(const QByteArray& msg)
+{
+    QString str = QString(msg.toBase64());
+    RawSendNet(QString("TEAMDRAW") + delimiter + str);
+}
+
 void HWNewNet::askRoomsList()
 {
     if(netClientState != InLobby)