gameServer/HWProtoInRoomState.hs
changeset 8983 a25e18295959
parent 8924 13ac59499066
child 9035 e84d42a4311c
equal deleted inserted replaced
8982:0c0141cf851a 8983:a25e18295959
   167 
   167 
   168 
   168 
   169 handleCmd_inRoom ["TOGGLE_READY"] = do
   169 handleCmd_inRoom ["TOGGLE_READY"] = do
   170     cl <- thisClient
   170     cl <- thisClient
   171     chans <- roomClientsChans
   171     chans <- roomClientsChans
   172     if isMaster cl then
   172 
   173         return []
   173     return [
   174         else
   174         ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}),
   175         return [
   175         ModifyClient (\c -> c{isReady = not $ isReady cl}),
   176             ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}),
   176         AnswerClients chans $ if clientProto cl < 38 then
   177             ModifyClient (\c -> c{isReady = not $ isReady cl}),
   177                 [if isReady cl then "NOT_READY" else "READY", nick cl]
   178             AnswerClients chans $ if clientProto cl < 38 then
   178                 else
   179                     [if isReady cl then "NOT_READY" else "READY", nick cl]
   179                 ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl]
   180                     else
   180         ]
   181                     ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl]
       
   182             ]
       
   183 
   181 
   184 
   182 
   185 handleCmd_inRoom ["START_GAME"] = do
   183 handleCmd_inRoom ["START_GAME"] = do
   186     (ci, rnc) <- ask
   184     (ci, rnc) <- ask
   187     cl <- thisClient
   185     cl <- thisClient