Module server.games.coop
Classes
class CoopGame (*args, **kwargs)-
Expand source code
class CoopGame(Game): """Class for coop game""" init_mode = InitMode.NORMAL_LOBBY game_type = GameType.COOP def __init__(self, *args, **kwargs): kwargs["game_mode"] = "coop" super().__init__(*args, **kwargs) self.validity = ValidityState.COOP_NOT_RANKED self.game_options.update({ "Victory": Victory.SANDBOX, "TeamSpawn": "fixed", "RevealedCivilians": "No", "Difficulty": 3, "Expansion": "true" }) self.leaderboard_lock = asyncio.Lock() self.leaderboard_saved = False async def validate_game_mode_settings(self): """ Checks which only apply to the coop mode """ valid_options = { "Victory": (Victory.SANDBOX, ValidityState.WRONG_VICTORY_CONDITION), "TeamSpawn": ("fixed", ValidityState.SPAWN_NOT_FIXED), "RevealedCivilians": (FA.DISABLED, ValidityState.CIVILIANS_REVEALED), "Difficulty": (3, ValidityState.WRONG_DIFFICULTY), "Expansion": (FA.ENABLED, ValidityState.EXPANSION_DISABLED), } await self._validate_game_options(valid_options) async def process_game_results(self): """ When a coop game ends, we don't expect there to be any game results. """ passClass for coop game
Ancestors
Methods
async def process_game_results(self)-
Expand source code
async def process_game_results(self): """ When a coop game ends, we don't expect there to be any game results. """ passWhen a coop game ends, we don't expect there to be any game results.
async def validate_game_mode_settings(self)-
Expand source code
async def validate_game_mode_settings(self): """ Checks which only apply to the coop mode """ valid_options = { "Victory": (Victory.SANDBOX, ValidityState.WRONG_VICTORY_CONDITION), "TeamSpawn": ("fixed", ValidityState.SPAWN_NOT_FIXED), "RevealedCivilians": (FA.DISABLED, ValidityState.CIVILIANS_REVEALED), "Difficulty": (3, ValidityState.WRONG_DIFFICULTY), "Expansion": (FA.ENABLED, ValidityState.EXPANSION_DISABLED), } await self._validate_game_options(valid_options)Checks which only apply to the coop mode
Inherited members
Game:add_game_connectionadd_resultclear_slotgame_typeget_connected_playersget_player_optionget_team_setsinit_modeis_evenis_visible_to_playerlaunchload_resultspersist_resultsplayersremove_game_connectionset_ai_optionset_name_uncheckedset_player_optionteamsupdate_game_statsvalidate_game_settings