# HG changeset patch # User unc0rr # Date 1354472061 -14400 # Node ID 328f429c3ecc6cde635a6389d58c0174157938cc # Parent fa725fe25708a7d89a9ce2506ab9c5b914a5ca1b - Disable in-room bans - Actually check for banned nickname diff -r fa725fe25708 -r 328f429c3ecc gameServer/Actions.hs --- a/gameServer/Actions.hs Sun Dec 02 17:23:13 2012 +0100 +++ b/gameServer/Actions.hs Sun Dec 02 22:14:21 2012 +0400 @@ -441,17 +441,25 @@ return () -processAction (ProcessAccountInfo info) = +processAction (ProcessAccountInfo info) = do case info of HasAccount passwd isAdmin -> do - chan <- client's sendChan - mapM_ processAction [AnswerClients [chan] ["ASKPASSWORD"], ModifyClient (\c -> c{webPassword = passwd, isAdministrator = isAdmin})] - Guest -> - processAction JoinLobby + b <- isBanned + when (not b) $ do + chan <- client's sendChan + mapM_ processAction [AnswerClients [chan] ["ASKPASSWORD"], ModifyClient (\c -> c{webPassword = passwd, isAdministrator = isAdmin})] + Guest -> do + b <- isBanned + when (not b) $ + processAction JoinLobby Admin -> do mapM_ processAction [ModifyClient (\cl -> cl{isAdministrator = True}), JoinLobby] chan <- client's sendChan processAction $ AnswerClients [chan] ["ADMIN_ACCESS"] + where + isBanned = do + processAction CheckBanned + liftM B.null $ client's nick processAction JoinLobby = do diff -r fa725fe25708 -r 328f429c3ecc gameServer/HWProtoInRoomState.hs --- a/gameServer/HWProtoInRoomState.hs Sun Dec 02 17:23:13 2012 +0100 +++ b/gameServer/HWProtoInRoomState.hs Sun Dec 02 22:14:21 2012 +0400 @@ -308,8 +308,8 @@ let sameRoom = clientRoom rnc thisClientId == clientRoom rnc banId if master && isJust maybeClientId && (banId /= thisClientId) && sameRoom then return [ - ModifyRoom (\r -> r{roomBansList = let h = host $ rnc `client` banId in h `deepseq` h : roomBansList r}) - , KickRoomClient banId +-- ModifyRoom (\r -> r{roomBansList = let h = host $ rnc `client` banId in h `deepseq` h : roomBansList r}) + KickRoomClient banId ] else return []