def create_game(self, visibility=VisibilityState.PUBLIC, game_mode: str=None, host: Player=None, name: str=None, mapname: str=None, password: str=None): """ Main entrypoint for creating new games """ id = self.createUuid() args = { "id": id, "host": host, "name": name, "map": mapname, "game_mode": game_mode, "game_service": self, "game_stats_service": self.game_stats_service } if game_mode == 'ladder1v1': game = LadderGame(**args) elif game_mode == 'coop': game = CoopGame(**args) elif game_mode == 'faf' or game_mode == 'fafbeta' or game_mode == 'equilibrium': game = CustomGame(**args) else: game = Game(**args) self.games[id] = game game.visibility = visibility game.password = password self.mark_dirty(game) return game
def custom_game(loop, game_service, game_stats_service): game = CustomGame(42, game_service, game_stats_service) yield game loop.run_until_complete(game.clear_data())
def custom_game(event_loop, database, game_service, game_stats_service): return CustomGame(42, database, game_service, game_stats_service)
def custom_game(loop, game_service, game_stats_service): game = CustomGame(42, game_service, game_stats_service) yield game loop.run_until_complete(game.clear_data())
def custom_game(event_loop, database, game_service, game_stats_service): game = CustomGame(42, database, game_service, game_stats_service) yield game