QTfrontend/game.cpp
changeset 1358 99ba722e5a09
parent 1356 77ab8735401d
child 1369 f5b1b3fd70cc
--- a/QTfrontend/game.cpp	Wed Oct 15 15:59:19 2008 +0000
+++ b/QTfrontend/game.cpp	Wed Oct 15 16:25:34 2008 +0000
@@ -157,6 +157,7 @@
 
 void HWGame::ParseMessage(const QByteArray & msg)
 {
+qDebug() << msg;
 	switch(msg.at(1)) {
 		case '?': {
 			SendIPC("!");
@@ -165,11 +166,11 @@
 		case 'C': {
 			switch (gameType) {
 				case gtLocal: {
-				 	SendConfig();
+					SendConfig();
 					break;
 				}
 				case gtQLocal: {
-				 	SendQuickConfig();
+					SendQuickConfig();
 					break;
 				}
 				case gtDemo: break;
@@ -178,7 +179,7 @@
 					break;
 				}
 				case gtTraining: {
-				 	SendTrainingConfig();
+					SendTrainingConfig();
 					break;
 				}
 			}
@@ -216,13 +217,19 @@
 		}
 		case 's': {
 			int size = msg.size();
-			emit SendChat(QString::fromUtf8(msg.mid(2).left(size - 4)));
+			QString msgbody = QString::fromUtf8(msg.mid(2).left(size - 4));
+			emit SendChat(msgbody);
+			QByteArray buf;
+			HWProto::addStringToBuffer(buf, QString("s%1: %2\x20\x20").arg(config->netNick()).arg(msgbody));
+			demo.append(buf);
+			break;
 		}
 		default: {
 			if (gameType == gtNet)
 			{
 				emit SendNet(msg);
 			}
+		if (msg.at(1) != 's')
 			demo.append(msg);
 		}
 	}