gameServer/HWProtoInRoomState.hs
changeset 10392 5012e1f9e893
parent 10217 1a1da2342c5b
child 10460 8dcea9087d75
equal deleted inserted replaced
10391:ce3ccc45d790 10392:5012e1f9e893
    28     if (playersIn rm == readyPlayers rm || clientProto cl > 43) && not (isJust $ gameInfo rm) then
    28     if (playersIn rm == readyPlayers rm || clientProto cl > 43) && not (isJust $ gameInfo rm) then
    29         if enoughClans rm then
    29         if enoughClans rm then
    30             return [
    30             return [
    31                 ModifyRoom
    31                 ModifyRoom
    32                     (\r -> r{
    32                     (\r -> r{
    33                         gameInfo = Just $ newGameInfo (teams rm) (length $ teams rm) allPlayersRegistered (mapParams rm) (params rm)
    33                         gameInfo = Just $ newGameInfo (teams rm) (length $ teams rm) allPlayersRegistered (mapParams rm) (params rm) False
    34                         }
    34                         }
    35                     )
    35                     )
    36                 , AnswerClients chans ["RUN_GAME"]
    36                 , AnswerClients chans ["RUN_GAME"]
    37                 , SendUpdateOnThisRoom
    37                 , SendUpdateOnThisRoom
    38                 , AnswerClients chans $ "CLIENT_FLAGS" : "+g" : nicks
    38                 , AnswerClients chans $ "CLIENT_FLAGS" : "+g" : nicks
   372     return [ModifyRoom (\r -> r{greeting = msg}) | isAdministrator cl || (isMaster cl && (not $ isSpecial rm))]
   372     return [ModifyRoom (\r -> r{greeting = msg}) | isAdministrator cl || (isMaster cl && (not $ isSpecial rm))]
   373 
   373 
   374 
   374 
   375 handleCmd_inRoom ["CALLVOTE"] = do
   375 handleCmd_inRoom ["CALLVOTE"] = do
   376     cl <- thisClient
   376     cl <- thisClient
   377     return [AnswerClients [sendChan cl] ["CHAT", "[server]", "Available callvote commands: kick <nickname>, map <name>"]]
   377     return [AnswerClients [sendChan cl] ["CHAT", "[server]", "Available callvote commands: kick <nickname>, map <name>, pause"]]
   378 
   378 
   379 handleCmd_inRoom ["CALLVOTE", "KICK"] = do
   379 handleCmd_inRoom ["CALLVOTE", "KICK"] = do
   380     cl <- thisClient
   380     cl <- thisClient
   381     return [AnswerClients [sendChan cl] ["CHAT", "[server]", "callvote kick: specify nickname"]]
   381     return [AnswerClients [sendChan cl] ["CHAT", "[server]", "callvote kick: specify nickname"]]
   382 
   382 
   410     if Map.member roomSave $ roomSaves rm then
   410     if Map.member roomSave $ roomSaves rm then
   411         startVote $ VoteMap roomSave
   411         startVote $ VoteMap roomSave
   412         else
   412         else
   413         return [AnswerClients [sendChan cl] ["CHAT", "[server]", "callvote map: no such map"]]
   413         return [AnswerClients [sendChan cl] ["CHAT", "[server]", "callvote map: no such map"]]
   414 
   414 
       
   415 handleCmd_inRoom ["CALLVOTE", "PAUSE"] = do
       
   416     cl <- thisClient
       
   417     rm <- thisRoom
       
   418 
       
   419     if isJust $ gameInfo rm then
       
   420         startVote VotePause    
       
   421         else 
       
   422         return [AnswerClients [sendChan cl] ["CHAT", "[server]", "callvote pause: no game in progress"]]
   415 
   423 
   416 handleCmd_inRoom ["VOTE", m] = do
   424 handleCmd_inRoom ["VOTE", m] = do
   417     cl <- thisClient
   425     cl <- thisClient
   418     let b = if m == "YES" then Just True else if m == "NO" then Just False else Nothing
   426     let b = if m == "YES" then Just True else if m == "NO" then Just False else Nothing
   419     if isJust b then
   427     if isJust b then