Send team removal message on incorrect engine shutdown (when game not finished). Should help with game hang when room master closes engine, then quits room.
--- a/gameServer/HWProtoInRoomState.hs Thu Feb 16 16:16:59 2012 +0100
+++ b/gameServer/HWProtoInRoomState.hs Thu Feb 16 20:32:47 2012 +0400
@@ -206,11 +206,12 @@
handleCmd_inRoom ["ROUNDFINISHED", correctly] = do
+ clId <- asks fst
cl <- thisClient
rm <- thisRoom
chans <- roomClientsChans
- if isMaster cl && (isJust $ gameInfo rm) then
+ if isMaster cl && isCorrect && (isJust $ gameInfo rm) then
return $
SaveReplay
: ModifyRoom
@@ -222,7 +223,7 @@
: UnreadyRoomClients
: answerRemovedTeams chans rm
else
- return []
+ return [RemoveClientTeams clId]
where
answerRemovedTeams chans = map (\t -> AnswerClients chans ["REMOVE_TEAM", t]) . leftTeams . fromJust . gameInfo
isCorrect = correctly == "1"