gameServer/HWProtoInRoomState.hs
changeset 7775 835ad028fb66
parent 7766 98edc0724a28
child 7862 bd76ca40db68
equal deleted inserted replaced
7773:3d460e57d4e6 7775:835ad028fb66
   155 
   155 
   156 
   156 
   157 handleCmd_inRoom ["TOGGLE_READY"] = do
   157 handleCmd_inRoom ["TOGGLE_READY"] = do
   158     cl <- thisClient
   158     cl <- thisClient
   159     chans <- roomClientsChans
   159     chans <- roomClientsChans
   160     return [
   160     if isMaster cl then
   161         ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}),
   161         return []
   162         ModifyClient (\c -> c{isReady = not $ isReady cl}),
   162         else
   163         AnswerClients chans $ if clientProto cl < 38 then
   163         return [
   164                 [if isReady cl then "NOT_READY" else "READY", nick cl]
   164             ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}),
   165                 else
   165             ModifyClient (\c -> c{isReady = not $ isReady cl}),
   166                 ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl]
   166             AnswerClients chans $ if clientProto cl < 38 then
   167         ]
   167                     [if isReady cl then "NOT_READY" else "READY", nick cl]
       
   168                     else
       
   169                     ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl]
       
   170             ]
   168 
   171 
   169 handleCmd_inRoom ["START_GAME"] = do
   172 handleCmd_inRoom ["START_GAME"] = do
   170     (ci, rnc) <- ask
   173     (ci, rnc) <- ask
   171     cl <- thisClient
   174     cl <- thisClient
   172     rm <- thisRoom
   175     rm <- thisRoom