gameServer/Actions.hs
changeset 5119 f475e10c4081
parent 5092 28e0a6d2d09a
child 5143 649d87819682
equal deleted inserted replaced
5118:9cfdb9bc6140 5119:f475e10c4081
   209             else
   209             else
   210             processAction RemoveRoom
   210             processAction RemoveRoom
   211         else
   211         else
   212         mapM_ processAction [AnswerClients chans ["LEFT", clNick, msg], RemoveClientTeams ci]
   212         mapM_ processAction [AnswerClients chans ["LEFT", clNick, msg], RemoveClientTeams ci]
   213 
   213 
   214     io $ do
   214     -- when not removing room
       
   215     when (not master || (gameProgress && playersNum > 1)) . io $ do
   215         modifyRoom rnc (\r -> r{
   216         modifyRoom rnc (\r -> r{
   216                 playersIn = playersIn r - 1,
   217                 playersIn = playersIn r - 1,
   217                 readyPlayers = if ready then readyPlayers r - 1 else readyPlayers r
   218                 readyPlayers = if ready then readyPlayers r - 1 else readyPlayers r
   218                 }) ri
   219                 }) ri
   219         moveClientToLobby rnc ci
   220         moveClientToLobby rnc ci
   406     modify (\s -> s{clientIndex = Just newClId})
   407     modify (\s -> s{clientIndex = Just newClId})
   407     mapM_ processAction
   408     mapM_ processAction
   408         [
   409         [
   409             AnswerClients [sendChan cl] ["CONNECTED", "Hedgewars server http://www.hedgewars.org/", serverVersion]
   410             AnswerClients [sendChan cl] ["CONNECTED", "Hedgewars server http://www.hedgewars.org/", serverVersion]
   410             , CheckBanned
   411             , CheckBanned
   411 --            , AddIP2Bans (host cl) "Reconnected too fast" (addUTCTime 10 $ connectTime cl)
   412             , AddIP2Bans (host cl) "Reconnected too fast" (addUTCTime 10 $ connectTime cl)
   412         ]
   413         ]
   413 
   414 
   414 
   415 
   415 processAction (AddNick2Bans n reason expiring) = do
   416 processAction (AddNick2Bans n reason expiring) = do
   416     processAction $ ModifyServerInfo (\s -> s{bans = BanByNick n reason expiring : bans s})
   417     processAction $ ModifyServerInfo (\s -> s{bans = BanByNick n reason expiring : bans s})