matchmaking: add: players counter in room

This commit is contained in:
starnakin 2023-12-23 16:58:03 +01:00
parent 39ea33cc8e
commit f9bf3a566e

View File

@ -28,8 +28,7 @@ class MatchMaking(WebsocketConsumer):
waiting_room: WaitingRoom = normal.get(self.mode)
waiting_room.append(Waiter(user.pk, self))
print(len(waiting_room), "/", self.mode, [len(waiting_room),self.mode])
waiting_room.broadcast(f"{len(waiting_room)} / {waiting_room._mode}")
if (len(waiting_room) == self.mode):
game_id: int = GameModel().create(waiting_room.get_users_id())
waiting_room.broadcast("game_found", {"game_id": game_id})