Frontend sends ROUNDFINISHED with information about whether the round was played till end (will be needed for stats)
--- a/QTfrontend/hwform.cpp Wed Feb 02 21:53:19 2011 +0300
+++ b/QTfrontend/hwform.cpp Wed Feb 02 22:14:00 2011 +0300
@@ -970,7 +970,7 @@
Music(ui.pageOptions->CBEnableFrontendMusic->isChecked());
if (wBackground) wBackground->startAnimation();
GoToPage(ID_PAGE_GAMESTATS);
- if (hwnet && (!game || !game->netSuspend)) hwnet->gameFinished();
+ if (hwnet && (!game || !game->netSuspend)) hwnet->gameFinished(true);
if (game) game->netSuspend = false;
break;
}
@@ -985,7 +985,7 @@
if (id == ID_PAGE_INGAME) GoBack();
Music(ui.pageOptions->CBEnableFrontendMusic->isChecked());
if (wBackground) wBackground->startAnimation();
- if (hwnet) hwnet->gameFinished();
+ if (hwnet) hwnet->gameFinished(false);
}
if (gameState == gsHalted) close();
};
--- a/QTfrontend/newnetclient.cpp Wed Feb 02 21:53:19 2011 +0300
+++ b/QTfrontend/newnetclient.cpp Wed Feb 02 22:14:00 2011 +0300
@@ -693,10 +693,10 @@
return isChief;
}
-void HWNewNet::gameFinished()
+void HWNewNet::gameFinished(bool correctly)
{
if (netClientState == 5) netClientState = 3;
- RawSendNet(QString("ROUNDFINISHED"));
+ RawSendNet(QString("ROUNDFINISHED%1%2").arg(delimeter).arg(correctly ? "1" : "0"));
}
void HWNewNet::banPlayer(const QString & nick)
--- a/QTfrontend/newnetclient.h Wed Feb 02 21:53:19 2011 +0300
+++ b/QTfrontend/newnetclient.h Wed Feb 02 22:14:00 2011 +0300
@@ -148,7 +148,7 @@
void JoinRoom(const QString & room);
void CreateRoom(const QString & room);
void askRoomsList();
- void gameFinished();
+ void gameFinished(bool correcly);
void banPlayer(const QString &);
void kickPlayer(const QString &);
void infoPlayer(const QString &);
--- a/gameServer/HWProtoInRoomState.hs Wed Feb 02 21:53:19 2011 +0300
+++ b/gameServer/HWProtoInRoomState.hs Wed Feb 02 22:14:00 2011 +0300
@@ -195,7 +195,7 @@
(isLegal, isKeepAlive) = checkNetCmd msg
-handleCmd_inRoom ["ROUNDFINISHED"] = do
+handleCmd_inRoom ["ROUNDFINISHED", _] = do
cl <- thisClient
r <- thisRoom
chans <- roomClientsChans