cleaned up code
This commit is contained in:
@ -87,13 +87,17 @@ class GameManager:
|
||||
# creates a player and handles counting all players and if conditions met starting the game
|
||||
# returns the new dict in which the new player now is added
|
||||
def addPlayers(self, player:Player, socket:socket, clientAddr) -> dict:
|
||||
|
||||
self.__gameManager.getLogger().info(f"creating user with id: {player.getID}")
|
||||
self.__players[clientAddr] = {
|
||||
player: player,
|
||||
socket:socket
|
||||
}
|
||||
self.__gameManager.getLogger().info(f"new length of user dictionary: {len(self.__players)}")
|
||||
|
||||
# counts participating players and starts the game if enough have joined
|
||||
if len(self.__players) == 2:
|
||||
self.__gameManager.getLogger().info("2 players have join game starts")
|
||||
self.startGame(socket)
|
||||
|
||||
return self.__players
|
Reference in New Issue
Block a user