# HG changeset patch # User unc0rr # Date 1381686822 -14400 # Node ID 9351e96990aebd4eabd0a5d5310829bb6c2f2e7a # Parent 2fd51591b26079c99dc602ceb9947bf52ee63596 Send +i status of all players to logged-in users diff -r 2fd51591b260 -r 9351e96990ae gameServer/Actions.hs --- a/gameServer/Actions.hs Sun Oct 13 13:14:32 2013 -0400 +++ b/gameServer/Actions.hs Sun Oct 13 21:53:42 2013 +0400 @@ -456,6 +456,7 @@ processAction JoinLobby = do chan <- client's sendChan + rnc <- gets roomsClients clientNick <- client's nick isAuthenticated <- liftM (not . B.null) $ client's webPassword isAdmin <- client's isAdministrator @@ -465,6 +466,10 @@ let authenticatedNicks = L.map nick . L.filter (not . B.null . webPassword) $ loggedInClients let adminsNicks = L.map nick . L.filter isAdministrator $ loggedInClients let contrNicks = L.map nick . L.filter isContributor $ loggedInClients + inRoomNicks <- io $ + allClientsM rnc + >>= filterM (liftM ((/=) lobbyId) . clientRoomM rnc) + >>= mapM (client'sM rnc nick) let clFlags = B.concat . L.concat $ [["u" | isAuthenticated], ["a" | isAdmin], ["c" | isContr]] mapM_ processAction . concat $ [ [AnswerClients clientsChans ["LOBBY:JOINED", clientNick]] @@ -472,6 +477,7 @@ , [AnswerClients [chan] ("CLIENT_FLAGS" : "+u" : authenticatedNicks) | not $ null authenticatedNicks] , [AnswerClients [chan] ("CLIENT_FLAGS" : "+a" : adminsNicks) | not $ null adminsNicks] , [AnswerClients [chan] ("CLIENT_FLAGS" : "+c" : contrNicks) | not $ null contrNicks] + , [AnswerClients [chan] ("CLIENT_FLAGS" : "+i" : inRoomNicks) | not $ null inRoomNicks] , [AnswerClients (chan : clientsChans) ["CLIENT_FLAGS", B.concat["+" , clFlags], clientNick] | not $ B.null clFlags] , [ModifyClient (\cl -> cl{logonPassed = True, isVisible = True})] , [SendServerMessage] diff -r 2fd51591b260 -r 9351e96990ae gameServer/CoreTypes.hs --- a/gameServer/CoreTypes.hs Sun Oct 13 13:14:32 2013 -0400 +++ b/gameServer/CoreTypes.hs Sun Oct 13 21:53:42 2013 +0400 @@ -101,7 +101,6 @@ logonPassed :: Bool, isVisible :: Bool, clientProto :: !Word16, - roomID :: RoomIndex, pingsQueue :: !Word, isMaster :: Bool, isReady :: !Bool, diff -r 2fd51591b260 -r 9351e96990ae gameServer/NetRoutines.hs --- a/gameServer/NetRoutines.hs Sun Oct 13 13:14:32 2013 -0400 +++ b/gameServer/NetRoutines.hs Sun Oct 13 21:53:42 2013 +0400 @@ -36,7 +36,6 @@ False False 0 - lobbyId 0 False False