QTfrontend/newnetclient.cpp
changeset 1351 aa7aefec5c1b
parent 1344 4004e597f1bf
child 1354 a8dcdeb88a43
--- a/QTfrontend/newnetclient.cpp	Mon Oct 13 18:37:59 2008 +0000
+++ b/QTfrontend/newnetclient.cpp	Mon Oct 13 19:04:27 2008 +0000
@@ -262,6 +262,12 @@
 			return;
 		}
 		m_pTeamSelWidget->removeNetTeam(HWTeam(lst[1]));
+		if (netClientState == 5) // we're in game, need to tell the engine about this
+		{
+			QByteArray em;
+			HWProto::addStringToBuffer(em, "F" + lst[1]);
+			emit FromNet(em);
+		}
 		return;
 	}
 
@@ -297,6 +303,7 @@
 	}
 
 	if (lst[0] == "RUN_GAME") {
+		netClientState = 5;
 		RunGame();
 		return;
 	}
@@ -381,18 +388,18 @@
 		return;
 	}
 
-  if (lst[0] == "GAMEMSG") {
-    if(lst.size() < 2)
-    {
-      qWarning("Net: Bad GAMEMSG message");
-      return;
-    }
-    QByteArray em = QByteArray::fromBase64(lst[1].toAscii());
-    emit FromNet(em);
-    return;
-  }
+	if (lst[0] == "GAMEMSG") {
+		if(lst.size() < 2)
+		{
+			qWarning("Net: Bad GAMEMSG message");
+			return;
+		}
+		QByteArray em = QByteArray::fromBase64(lst[1].toAscii());
+		emit FromNet(em);
+		return;
+	}
 
-  qWarning() << "Net: Unknown message:" << lst;
+	qWarning() << "Net: Unknown message:" << lst;
 }
 
 
@@ -494,5 +501,6 @@
 
 void HWNewNet::gameFinished()
 {
+	netClientState = 3;
 	RawSendNet(QString("ROUNDFINISHED"));
 }