Skip to content

Commit

Permalink
provide game_info on join to players too
Browse files Browse the repository at this point in the history
  • Loading branch information
dgomes committed Nov 13, 2021
1 parent 9e01041 commit 167591d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ async def incomming_handler(self, websocket, path):
if path == "/viewer":
logger.info("Viewer connected")
self.viewers.add(websocket)
game_info = self.game.info()
await websocket.send(json.dumps(game_info))

game_info = self.game.info()
await websocket.send(json.dumps(game_info))

if data["cmd"] == "key" and self.current_player.ws == websocket:
logger.debug((self.current_player.name, data))
Expand Down

0 comments on commit 167591d

Please sign in to comment.