le caca coule au cucu
This commit is contained in:
@ -39,9 +39,9 @@ class MatchMaking(WebsocketConsumer):
|
||||
self.disconnect(1000)
|
||||
return
|
||||
|
||||
if (self.mode < 2 or self.mode > 4):
|
||||
if (self.gamemode not in ["tictactoe", "pong"]):
|
||||
data: dict = {
|
||||
"detail": "The mode must be > 1 and < 4.",
|
||||
"detail": "The gamemode must 'pong' or 'tictactoe'.",
|
||||
}
|
||||
self.send(json.dumps(data))
|
||||
self.disconnect(1000)
|
||||
@ -49,8 +49,8 @@ class MatchMaking(WebsocketConsumer):
|
||||
|
||||
waiting_room.broadcast(f"{len(waiting_room)} / {waiting_room.mode}")
|
||||
if (len(waiting_room) == waiting_room.mode):
|
||||
game_id: int = GameModel().create(waiting_room.get_users_id())
|
||||
waiting_room.broadcast("game_found", {"game_id": game_id})
|
||||
game_id: int = GameModel().create(self.gamemode, waiting_room.get_users_id())
|
||||
waiting_room.broadcast("game_found", {"game_id": game_id, "gamemode": self.gamemode})
|
||||
waiting_room.clear()
|
||||
|
||||
def disconnect(self, close_code):
|
||||
|
Reference in New Issue
Block a user