Skip to content

Commit

Permalink
Send social info before games info
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
duk3luk3 authored and micheljung committed Aug 28, 2017
1 parent 504a75e commit dc963f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/lobbyconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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):
Expand Down

0 comments on commit dc963f4

Please sign in to comment.