gameServer/HWProtoInRoomState.hs
changeset 13510 60bcc20e6ab0
parent 13509 9ba5e4594322
child 13673 1aa5e884326a
equal deleted inserted replaced
13509:9ba5e4594322 13510:60bcc20e6ab0
   494 handleCmd_inRoom ("VOTE" : m : p) = do
   494 handleCmd_inRoom ("VOTE" : m : p) = do
   495     cl <- thisClient
   495     cl <- thisClient
   496     let b = if m == "YES" then Just True else if m == "NO" then Just False else Nothing
   496     let b = if m == "YES" then Just True else if m == "NO" then Just False else Nothing
   497     if isJust b then
   497     if isJust b then
   498         voted (p == ["FORCE"]) (fromJust b)
   498         voted (p == ["FORCE"]) (fromJust b)
   499         else
   499     else
   500         return [AnswerClients [sendChan cl] ["CHAT", "[server]", "/vote: Please use 'yes' or 'no'."]]
   500         return [AnswerClients [sendChan cl] ["CHAT", "[server]",
       
   501             if (p == ["FORCE"]) then
       
   502                 loc "/force: Please use 'yes' or 'no'."
       
   503             else
       
   504                 loc "/vote: Please use 'yes' or 'no'."
       
   505         ]]
   501 
   506 
   502 
   507 
   503 handleCmd_inRoom ["SAVE", stateName, location] = serverAdminOnly $ do
   508 handleCmd_inRoom ["SAVE", stateName, location] = serverAdminOnly $ do
   504     return [ModifyRoom $ \r -> r{roomSaves = Map.insert stateName (location, mapParams r, params r) (roomSaves r)}]
   509     return [ModifyRoom $ \r -> r{roomSaves = Map.insert stateName (location, mapParams r, params r) (roomSaves r)}]
   505 
   510