gameServer/HWProtoInRoomState.hs
changeset 7266 74ad631a72bf
parent 6912 831416764d2d
child 7321 57bd4f201401
equal deleted inserted replaced
7265:3f96073156e1 7266:74ad631a72bf
   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     return [
       
   161         ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}),
   161         ModifyClient (\c -> c{isReady = not $ isReady cl}),
   162         ModifyClient (\c -> c{isReady = not $ isReady cl}),
   162         ModifyRoom (\r -> r{readyPlayers = readyPlayers r + (if isReady cl then -1 else 1)}),
       
   163         AnswerClients chans $ if clientProto cl < 38 then
   163         AnswerClients chans $ if clientProto cl < 38 then
   164                 [if isReady cl then "NOT_READY" else "READY", nick cl]
   164                 [if isReady cl then "NOT_READY" else "READY", nick cl]
   165                 else
   165                 else
   166                 ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl]
   166                 ["CLIENT_FLAGS", if isReady cl then "-r" else "+r", nick cl]
   167         ]
   167         ]