game: add: player can leave and join game

This commit is contained in:
2024-01-18 13:59:19 +01:00
parent fa38ba6eb8
commit 1589763197
3 changed files with 7 additions and 6 deletions

View File

@ -98,7 +98,7 @@ class Game(AbstractRoom):
return player
def _player_leave(self, player: Player):
# TODO send data to all players
self.broadcast("player_leave", player.to_dict(), [player])
self.players.remove(player)
def _spectator_join(self, user_id: int, socket: WebsocketConsumer):