gameServer/HWProtoInRoomState.hs
changeset 13515 9ba5e4594322
parent 13514 da59012fbd7a
child 13516 60bcc20e6ab0
equal deleted inserted replaced
13514:da59012fbd7a 13515:9ba5e4594322
    31 import Utils
    31 import Utils
    32 import HandlerUtils
    32 import HandlerUtils
    33 import RoomsAndClients
    33 import RoomsAndClients
    34 import EngineInteraction
    34 import EngineInteraction
    35 import Votes
    35 import Votes
       
    36 import CommandHelp
    36 
    37 
    37 startGame :: Reader (ClientIndex, IRnC) [Action]
    38 startGame :: Reader (ClientIndex, IRnC) [Action]
    38 startGame = do
    39 startGame = do
    39     (ci, rnc) <- ask
    40     (ci, rnc) <- ask
    40     cl <- thisClient
    41     cl <- thisClient
   405 handleCmd_inRoom ["UNFIX"] = serverAdminOnly $
   406 handleCmd_inRoom ["UNFIX"] = serverAdminOnly $
   406     return [ModifyRoom (\r -> r{isSpecial = False})]
   407     return [ModifyRoom (\r -> r{isSpecial = False})]
   407 
   408 
   408 handleCmd_inRoom ["HELP"] = do
   409 handleCmd_inRoom ["HELP"] = do
   409     cl <- thisClient
   410     cl <- thisClient
   410     return [
   411     if isAdministrator cl then
   411         AnswerClients [sendChan cl] ["CHAT", "[server]", loc "List of chat command for rooms:"],
   412         return (cmdHelpActionList [sendChan cl] cmdHelpRoomAdmin)
   412         AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /greeting: Set greeting message to be shown to players who join the room"],
   413     else
   413         AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /delegate <player>: Surrender room control to player"],
   414         return (cmdHelpActionList [sendChan cl] cmdHelpRoomPlayer)
   414         AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /maxteams <N>: Limit maximum number of teams to N"],
       
   415         AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /callvote [arguments]: Start a vote"],
       
   416         AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /vote <yes/no>: Vote 'yes' or 'no' for active vote"],
       
   417         AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /info <player>: Show info about player"],
       
   418         AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /me <message>: Chat action, e.g. '/me eats piza' becomes '* Player eats pizza'"],
       
   419         AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /rnd: Flip a virtual coin and write 'heads' or 'tails' in chat"],
       
   420         AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /rnd [A] [B] [C] [...]: Randomly select a word and write it in chat"],
       
   421         AnswerClients [sendChan cl] ["CHAT", "[server]", loc " /help: Show command help"] ]
       
   422 
   415 
   423 handleCmd_inRoom ["GREETING", msg] = do
   416 handleCmd_inRoom ["GREETING", msg] = do
   424     cl <- thisClient
   417     cl <- thisClient
   425     rm <- thisRoom
   418     rm <- thisRoom
   426     return [ModifyRoom (\r -> r{greeting = msg}) | isAdministrator cl || (isMaster cl && (not $ isSpecial rm))]
   419     return [ModifyRoom (\r -> r{greeting = msg}) | isAdministrator cl || (isMaster cl && (not $ isSpecial rm))]