Clients send roundfinished message to server when the round is over
authorunc0rr
Sun, 12 Oct 2008 16:45:13 +0000
changeset 1344 4004e597f1bf
parent 1343 7a47a80b20ad
child 1345 73119de7d3be
Clients send roundfinished message to server when the round is over
QTfrontend/hwform.cpp
QTfrontend/newnetclient.cpp
QTfrontend/newnetclient.h
netserver/HWProto.hs
--- a/QTfrontend/hwform.cpp	Sun Oct 12 16:31:23 2008 +0000
+++ b/QTfrontend/hwform.cpp	Sun Oct 12 16:45:13 2008 +0000
@@ -581,6 +581,7 @@
 			GoBack();
 			Music(ui.pageOptions->CBEnableMusic->isChecked());
 			GoToPage(ID_PAGE_GAMESTATS);
+			if (hwnet) hwnet->gameFinished();
 			break;
 		}
 		default: {
@@ -588,6 +589,7 @@
 			if (id == ID_PAGE_INGAME) {
 				GoBack();
 				Music(ui.pageOptions->CBEnableMusic->isChecked());
+				if (hwnet) hwnet->gameFinished();
 			}
 		};
 	}
--- a/QTfrontend/newnetclient.cpp	Sun Oct 12 16:31:23 2008 +0000
+++ b/QTfrontend/newnetclient.cpp	Sun Oct 12 16:45:13 2008 +0000
@@ -491,3 +491,8 @@
 {
 	return isChief;
 }
+
+void HWNewNet::gameFinished()
+{
+	RawSendNet(QString("ROUNDFINISHED"));
+}
--- a/QTfrontend/newnetclient.h	Sun Oct 12 16:31:23 2008 +0000
+++ b/QTfrontend/newnetclient.h	Sun Oct 12 16:45:13 2008 +0000
@@ -125,6 +125,7 @@
   void JoinRoom(const QString & room);
   void CreateRoom(const QString & room);
   void askRoomsList();
+  void gameFinished();
 
  private slots:
   void ClientRead();
--- a/netserver/HWProto.hs	Sun Oct 12 16:31:23 2008 +0000
+++ b/netserver/HWProto.hs	Sun Oct 12 16:45:13 2008 +0000
@@ -218,6 +218,9 @@
 	else
 		(noChangeClients, noChangeRooms, answerRunGame)
 
+handleCmd_inRoom client _ _ ["ROUNDFINISHED"] =
+		(noChangeClients, noChangeRooms, [])
+
 handleCmd_inRoom client _ _ ["GAMEMSG", msg] =
 	(noChangeClients, noChangeRooms, [(othersInRoom, ["GAMEMSG", msg])])