gameServer/Actions.hs
changeset 13807 1f15b0ee8e34
parent 13730 5f62417a7d84
child 14287 9f0d81213d65
equal deleted inserted replaced
13806:54725a1d1db8 13807:1f15b0ee8e34
   477         HasAccount passwd isAdmin isContr -> do
   477         HasAccount passwd isAdmin isContr -> do
   478             b <- isBanned
   478             b <- isBanned
   479             c <- client's isChecker
   479             c <- client's isChecker
   480             when (not b) $ (if c then checkerLogin else playerLogin) passwd isAdmin isContr
   480             when (not b) $ (if c then checkerLogin else playerLogin) passwd isAdmin isContr
   481         Guest | isRegisteredUsersOnly si -> do
   481         Guest | isRegisteredUsersOnly si -> do
   482             processAction $ ByeClient "Registered users only"
   482             processAction $ ByeClient $ loc "This server only allows registered users to join."
   483             | otherwise -> do
   483             | otherwise -> do
   484             b <- isBanned
   484             b <- isBanned
   485             c <- client's isChecker
   485             c <- client's isChecker
   486             when (not b) $
   486             when (not b) $
   487                 if c then
   487                 if c then
   731             . Set.toList $ keys
   731             . Set.toList $ keys
   732     processAction $ Warning versionsStats
   732     processAction $ Warning versionsStats
   733 
   733 
   734 
   734 
   735 processAction (Random chans items) = do
   735 processAction (Random chans items) = do
   736     let i = if null items then ["heads", "tails"] else items
   736     let i = if null items then [loc "heads", loc "tails"] else items
   737     n <- io $ randomRIO (0, length i - 1)
   737     n <- io $ randomRIO (0, length i - 1)
   738     processAction $ AnswerClients chans ["CHAT", nickRandom, i !! n]
   738     processAction $ AnswerClients chans ["CHAT", if null items then nickRandomCoin else nickRandomCustom, i !! n]
   739 
   739 
   740 
   740 
   741 processAction (LoadGhost location) = do
   741 processAction (LoadGhost location) = do
   742     ri <- clientRoomA
   742     ri <- clientRoomA
   743     rnc <- gets roomsClients
   743     rnc <- gets roomsClients