From dc963f4e0568bc3703012b5c28ed78422170c34c Mon Sep 17 00:00:00 2001 From: Lukas Erlacher Date: Tue, 22 Aug 2017 22:28:00 +1000 Subject: [PATCH] Send social info before games info The information dump sent to the client after it logs in includes friends and foes (`social` message) and currently hosted / running games. Sending the `social` message first means friend/foe information will be available for the client so it can use it for coloring the hosted game display. Making this trivial change on the server avoids adding complex logic to the client to update the display of games after social information is received or holding back the display of games completely until that point. --- server/lobbyconnection.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/lobbyconnection.py b/server/lobbyconnection.py index eb9d4fd69..1588bbf9c 100644 --- a/server/lobbyconnection.py +++ b/server/lobbyconnection.py @@ -713,10 +713,6 @@ async def command_hello(self, message): self.player.friends = set(friends) self.player.foes = set(foes) - self.send_mod_list() - self.send_game_list() - self.send_tutorial_section() - channels = [] if self.player.mod: channels.append("#moderators") @@ -727,6 +723,10 @@ async def command_hello(self, message): jsonToSend = {"command": "social", "autojoin": channels, "channels": channels, "friends": friends, "foes": foes, "power": permission_group} self.sendJSON(jsonToSend) + self.send_mod_list() + self.send_game_list() + self.send_tutorial_section() + @timed def command_ask_session(self, message): if self.check_version(message):