gameServer/HWProtoInRoomState.hs
changeset 6690 46b3f4776538
parent 6541 08ed346ed341
child 6721 7dbf8a0c1f5d
equal deleted inserted replaced
6689:98a239848ba2 6690:46b3f4776538
   204     where
   204     where
   205         (isLegal, isKeepAlive) = checkNetCmd msg
   205         (isLegal, isKeepAlive) = checkNetCmd msg
   206 
   206 
   207 
   207 
   208 handleCmd_inRoom ["ROUNDFINISHED", correctly] = do
   208 handleCmd_inRoom ["ROUNDFINISHED", correctly] = do
       
   209     clId <- asks fst
   209     cl <- thisClient
   210     cl <- thisClient
   210     rm <- thisRoom
   211     rm <- thisRoom
   211     chans <- roomClientsChans
   212     chans <- roomClientsChans
   212 
   213 
   213     if isMaster cl && (isJust $ gameInfo rm) then
   214     if isMaster cl && isCorrect && (isJust $ gameInfo rm) then
   214         return $
   215         return $
   215             SaveReplay
   216             SaveReplay
   216             : ModifyRoom
   217             : ModifyRoom
   217                 (\r -> r{
   218                 (\r -> r{
   218                     gameInfo = Nothing,
   219                     gameInfo = Nothing,
   220                     }
   221                     }
   221                 )
   222                 )
   222             : UnreadyRoomClients
   223             : UnreadyRoomClients
   223             : answerRemovedTeams chans rm
   224             : answerRemovedTeams chans rm
   224         else
   225         else
   225         return []
   226         return [RemoveClientTeams clId]
   226     where
   227     where
   227         answerRemovedTeams chans = map (\t -> AnswerClients chans ["REMOVE_TEAM", t]) . leftTeams . fromJust . gameInfo
   228         answerRemovedTeams chans = map (\t -> AnswerClients chans ["REMOVE_TEAM", t]) . leftTeams . fromJust . gameInfo
   228         isCorrect = correctly == "1"
   229         isCorrect = correctly == "1"
   229 
   230 
   230 -- compatibility with clients with protocol < 38
   231 -- compatibility with clients with protocol < 38