game controller cleanup

This commit is contained in:
2024-03-28 11:03:16 +01:00
parent 29b9839452
commit c386f38dcf
4 changed files with 82 additions and 68 deletions
+3 -3
View File
@@ -73,13 +73,13 @@ class ClientController:
await self.send_error("username must be longer than 3 characters")
return
if self.game_controller.get_player(username) is not None:
if self.game_controller.game.get_player(username) is not None:
await self.send_error("username already exists")
return
player = await self.game_controller.create_player(username)
player = await self.game_controller.game.create_player(username)
elif message.type == "login":
player = self.game_controller.get_player(username)
player = self.game_controller.game.get_player(username)
if player is None:
await self.send_error("player doesn't exists")