gameServer/Actions.hs
changeset 5092 28e0a6d2d09a
parent 5091 288dcbda3b77
child 5119 f475e10c4081
--- a/gameServer/Actions.hs	Sun Apr 03 13:34:04 2011 +0400
+++ b/gameServer/Actions.hs	Sun Apr 03 16:31:40 2011 +0400
@@ -219,9 +219,10 @@
         moveClientToLobby rnc ci
 
 processAction ChangeMaster = do
+    (Just ci) <- gets clientIndex
     ri <- clientRoomA
     rnc <- gets roomsClients
-    newMasterId <- liftM head . io $ roomClientsIndicesM rnc ri
+    newMasterId <- liftM (head . filter (/= ci)) . io $ roomClientsIndicesM rnc ri
     newMaster <- io $ client'sM rnc id newMasterId
     let newRoomName = nick newMaster
     mapM_ processAction [
@@ -407,7 +408,7 @@
         [
             AnswerClients [sendChan cl] ["CONNECTED", "Hedgewars server http://www.hedgewars.org/", serverVersion]
             , CheckBanned
-            , AddIP2Bans (host cl) "Reconnected too fast" (addUTCTime 10 $ connectTime cl)
+--            , AddIP2Bans (host cl) "Reconnected too fast" (addUTCTime 10 $ connectTime cl)
         ]