From f56bf0db736a9ec39aa832c993fddbb4f250788a Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Thu, 30 Sep 2021 13:22:25 +0200 Subject: [PATCH] MultiServer: remove legacy datapackage keys MultiServer: remove warning about legacy datapackage use MultiServer: remove legacy permission flags Options: add "random" option to all Choices LttP: remove random special handling from HeartColor --- MultiServer.py | 7 ------- Options.py | 6 ++---- worlds/__init__.py | 4 ---- worlds/alttp/Options.py | 7 ------- 4 files changed, 2 insertions(+), 22 deletions(-) diff --git a/MultiServer.py b/MultiServer.py index 28a510b9..674eccd4 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -469,9 +469,6 @@ async def on_client_connected(ctx: Context, client: Client): # Name them by feature or fork, as you feel is appropriate. 'tags': ctx.tags, 'version': Utils.version_tuple, - # TODO ~0.2.0 remove forfeit_mode and remaining_mode in favor of permissions - 'forfeit_mode': ctx.forfeit_mode, - 'remaining_mode': ctx.remaining_mode, 'permissions': { "forfeit": Permission.from_text(ctx.forfeit_mode), "remaining": Permission.from_text(ctx.remaining_mode), @@ -497,10 +494,6 @@ async def on_client_joined(ctx: Context, client: Client): f"{ctx.get_aliased_name(client.team, client.slot)} (Team #{client.team + 1}) " f"playing {ctx.games[client.slot]} has joined. " f"Client({version_str}), {client.tags}).") - # TODO: remove with 0.2 - if client.version < Version(0, 1, 7): - ctx.notify_client(client, - "Warning: Your client's datapackage handling may be unsupported soon. (Version < 0.1.7)") ctx.client_connection_timers[client.team, client.slot] = datetime.datetime.now(datetime.timezone.utc) diff --git a/Options.py b/Options.py index c2824197..b6280e29 100644 --- a/Options.py +++ b/Options.py @@ -137,10 +137,8 @@ class Choice(Option): @classmethod def from_text(cls, text: str) -> Choice: text = text.lower() - # TODO: turn on after most people have adjusted their yamls to no longer have suboptions with "random" in them - # maybe in 0.2? - # if text == "random": - # return cls(random.choice(list(cls.options.values()))) + if text == "random": + return cls(random.choice(list(cls.name_lookup))) for optionname, value in cls.options.items(): if optionname == text: return cls(value) diff --git a/worlds/__init__.py b/worlds/__init__.py index 61014a2b..f193a9f8 100644 --- a/worlds/__init__.py +++ b/worlds/__init__.py @@ -27,10 +27,6 @@ for world_name, world in AutoWorldRegister.world_types.items(): lookup_any_location_id_to_name.update(world.location_id_to_name) network_data_package = { - # Remove with 0.2.0 - "lookup_any_location_id_to_name": lookup_any_location_id_to_name, # legacy, to be removed - "lookup_any_item_id_to_name": lookup_any_item_id_to_name, # legacy, to be removed - "version": sum(world.data_version for world in AutoWorldRegister.world_types.values()), "games": games, } diff --git a/worlds/alttp/Options.py b/worlds/alttp/Options.py index d69bb0d2..64b07890 100644 --- a/worlds/alttp/Options.py +++ b/worlds/alttp/Options.py @@ -231,13 +231,6 @@ class HeartColor(Choice): option_green = 2 option_yellow = 3 - @classmethod - def from_text(cls, text: str) -> Choice: - # remove when this becomes a base Choice feature - if text == "random": - return cls(random.randint(0, 3)) - return super(HeartColor, cls).from_text(text) - class QuickSwap(DefaultOnToggle): displayname = "L/R Quickswapping"