From 01f1545b3e2876b529b6f815a4fa6d2215fb9b41 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Tue, 31 Aug 2021 16:04:37 +0200 Subject: [PATCH] AutoWorld: add forced_auto_forfeit and set it for StS --- MultiServer.py | 2 ++ worlds/AutoWorld.py | 4 ++++ worlds/spire/__init__.py | 2 ++ 3 files changed, 8 insertions(+) diff --git a/MultiServer.py b/MultiServer.py index aa760da6..e954de01 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -1193,6 +1193,8 @@ def update_client_status(ctx: Context, client: Client, new_status: ClientStatus) ctx.notify_all(finished_msg) if "auto" in ctx.forfeit_mode: forfeit_player(ctx, client.team, client.slot) + elif proxy_worlds[ctx.games[client.slot]].forced_auto_forfeit: + forfeit_player(ctx, client.team, client.slot) ctx.client_game_state[client.team, client.slot] = new_status diff --git a/worlds/AutoWorld.py b/worlds/AutoWorld.py index 96358fd6..694296f1 100644 --- a/worlds/AutoWorld.py +++ b/worlds/AutoWorld.py @@ -91,6 +91,10 @@ class World(metaclass=AutoWorldRegister): # the client finds its own items in its own world. remote_items: bool = True + # For games where after a victory it is impossible to go back in and get additional/remaining Locations checked. + # this forces forfeit: auto for those games. + forced_auto_forfeit: bool = False + # Hide World Type from various views. Does not remove functionality. hidden = False diff --git a/worlds/spire/__init__.py b/worlds/spire/__init__.py index 0c7ee9c9..c1f9229c 100644 --- a/worlds/spire/__init__.py +++ b/worlds/spire/__init__.py @@ -18,6 +18,8 @@ class SpireWorld(World): item_name_to_id = {name: data.code for name, data in item_table.items()} location_name_to_id = location_table + forced_auto_forfeit = True + def _get_slot_data(self): return { 'seed': "".join(self.world.slot_seeds[self.player].choice(string.ascii_letters) for i in range(16)),