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. """ pass
Class 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. """ pass
When 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_connection
add_result
clear_slot
game_type
get_connected_players
get_player_option
get_team_sets
init_mode
is_even
is_visible_to_player
launch
load_results
persist_results
players
remove_game_connection
set_ai_option
set_name_unchecked
set_player_option
teams
update_game_stats
validate_game_settings