gameServer/HWProtoInRoomState.hs
changeset 4942 1c85a8e6e11c
parent 4941 90572c338e60
child 4975 31da8979e5b1
--- a/gameServer/HWProtoInRoomState.hs	Tue Feb 15 21:12:22 2011 +0300
+++ b/gameServer/HWProtoInRoomState.hs	Wed Feb 16 12:07:30 2011 +0300
@@ -159,7 +159,10 @@
     return [
         ModifyClient (\c -> c{isReady = not $ isReady cl}),
         ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}),
-        AnswerClients chans ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl]
+        AnswerClients chans $ if clientProto cl < 38 then
+                [if isReady cl then "NOT_READY" else "READY", nick cl]
+                else
+                ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl]
         ]
 
 handleCmd_inRoom ["START_GAME"] = do
@@ -221,6 +224,10 @@
     where
         answerRemovedTeams chans = map (\t -> AnswerClients chans ["REMOVE_TEAM", t]) . leftTeams
 
+-- compatibility with clients with protocol < 38
+handleCmd_inRoom ["ROUNDFINISHED"] =
+    handleCmd_inRoom ["ROUNDFINISHED", "1"]
+
 handleCmd_inRoom ["TOGGLE_RESTRICT_JOINS"] = do
     cl <- thisClient
     return $