QTfrontend/game.cpp
changeset 306 7b61834edcf6
parent 297 279e10ec31b4
child 312 c36d0b34ac3d
--- a/QTfrontend/game.cpp	Tue Dec 19 17:20:14 2006 +0000
+++ b/QTfrontend/game.cpp	Thu Jan 04 16:27:45 2007 +0000
@@ -44,6 +44,7 @@
 void HWGame::onClientDisconnect()
 {
 	SaveDemo(cfgdir->absolutePath() + "/Demos/LastRound.hwd_" + cProtoVer);
+	emit GameStateChanged(gsFinished);
 }
 
 void HWGame::SendTeamConfig(int index)
@@ -99,7 +100,7 @@
 
 void HWGame::ParseMessage(const QByteArray & msg)
 {
-	switch(msg.data()[1]) {
+	switch(msg.at(1)) {
 		case '?': {
 			if (gameType == gtNet)
 				emit SendNet(QByteArray("\x01""?"));
@@ -155,6 +156,10 @@
 			}
 			break;
 		}
+		case 'i': {
+			emit GameStats(msg.at(2), QString::fromUtf8(msg.mid(3)));
+			break;
+		}
 		default: {
 			if (gameType == gtNet)
 			{
@@ -257,6 +262,7 @@
 	// run engine
 	demo = new QByteArray;
 	Start();
+	emit GameStateChanged(gsStarted);
 }
 
 void HWGame::StartNet()
@@ -264,6 +270,7 @@
 	gameType = gtNet;
 	demo = new QByteArray;
 	Start();
+	emit GameStateChanged(gsStarted);
 }
 
 void HWGame::StartLocal()
@@ -273,6 +280,7 @@
 	seed = gamecfg->getCurrentSeed();
 	demo = new QByteArray;
 	Start();
+	emit GameStateChanged(gsStarted);
 }
 
 void HWGame::StartQuick()
@@ -281,6 +289,7 @@
 	seed = gamecfg->getCurrentSeed();
 	demo = new QByteArray;
 	Start();
+	emit GameStateChanged(gsStarted);
 }