QTfrontend/game.cpp
changeset 1356 77ab8735401d
parent 1277 752b53481057
child 1358 99ba722e5a09
--- a/QTfrontend/game.cpp	Wed Oct 15 11:54:06 2008 +0000
+++ b/QTfrontend/game.cpp	Wed Oct 15 15:02:39 2008 +0000
@@ -201,13 +201,6 @@
 			}
 			return;
 		}
-		case '+': {
-			if (gameType == gtNet)
-			{
-				emit SendNet(msg);
-			}
-			break;
-		}
 		case 'i': {
 			int size = msg.size();
 			emit GameStats(msg.at(2), QString::fromUtf8(msg.mid(3).left(size - 5)));
@@ -221,6 +214,10 @@
 			SetGameState(gsFinished);
 			break;
 		}
+		case 's': {
+			int size = msg.size();
+			emit SendChat(QString::fromUtf8(msg.mid(2).left(size - 4)));
+		}
 		default: {
 			if (gameType == gtNet)
 			{
@@ -236,6 +233,13 @@
 	RawSendIPC(msg);
 }
 
+void HWGame::FromNetChat(const QString & msg)
+{
+	QByteArray buf;
+	HWProto::addStringToBuffer(buf, 's' + msg + "\x20\x20");
+	RawSendIPC(buf);
+}
+
 void HWGame::onClientRead()
 {
 	quint8 msglen;