From 2751ccdaabc7e55fdfaa68cbb1d6ea9bb1d666ce Mon Sep 17 00:00:00 2001 From: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> Date: Thu, 10 Oct 2024 21:02:31 -0400 Subject: [PATCH 1/9] DS3: Make your own region cache (#4040) * Make your own region cache * Using a string --- worlds/dark_souls_3/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worlds/dark_souls_3/__init__.py b/worlds/dark_souls_3/__init__.py index b51668539be2..1aec6945eb8b 100644 --- a/worlds/dark_souls_3/__init__.py +++ b/worlds/dark_souls_3/__init__.py @@ -89,6 +89,7 @@ def __init__(self, multiworld: MultiWorld, player: int): self.all_excluded_locations = set() def generate_early(self) -> None: + self.created_regions = set() self.all_excluded_locations.update(self.options.exclude_locations.value) # Inform Universal Tracker where Yhorm is being randomized to. @@ -294,6 +295,7 @@ def create_region(self, region_name, location_table) -> Region: new_region.locations.append(new_location) self.multiworld.regions.append(new_region) + self.created_regions.add(region_name) return new_region def create_items(self) -> None: @@ -1305,7 +1307,7 @@ def _add_location_rule(self, location: Union[str, List[str]], rule: Union[Collec def _add_entrance_rule(self, region: str, rule: Union[CollectionRule, str]) -> None: """Sets a rule for the entrance to the given region.""" assert region in location_tables - if not any(region == reg for reg in self.multiworld.regions.region_cache[self.player]): return + if region not in self.created_regions: return if isinstance(rule, str): if " -> " not in rule: assert item_dictionary[rule].classification == ItemClassification.progression From f495bf726101e5125e73a1aabb23ee9ab6518d04 Mon Sep 17 00:00:00 2001 From: Aaron Wagener Date: Thu, 10 Oct 2024 20:05:21 -0500 Subject: [PATCH 2/9] The Messenger: fix missing money wrench rule (#4041) * The Messenger: fix missing money wrench rule * add a unit test for money wrench --- worlds/messenger/rules.py | 2 ++ worlds/messenger/test/test_shop.py | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/worlds/messenger/rules.py b/worlds/messenger/rules.py index 85b73dec4147..c354ad70aba6 100644 --- a/worlds/messenger/rules.py +++ b/worlds/messenger/rules.py @@ -220,6 +220,8 @@ def __init__(self, world: "MessengerWorld") -> None: } self.location_rules = { + # hq + "Money Wrench": self.can_shop, # ninja village "Ninja Village Seal - Tree House": self.has_dart, diff --git a/worlds/messenger/test/test_shop.py b/worlds/messenger/test/test_shop.py index 971ff1763b47..ce6fd19e33c8 100644 --- a/worlds/messenger/test/test_shop.py +++ b/worlds/messenger/test/test_shop.py @@ -1,5 +1,6 @@ from typing import Dict +from BaseClasses import CollectionState from . import MessengerTestBase from ..shop import SHOP_ITEMS, FIGURINES @@ -89,3 +90,15 @@ def test_costs(self) -> None: self.assertTrue(loc in FIGURINES) self.assertEqual(len(figures), len(FIGURINES)) + + max_cost_state = CollectionState(self.multiworld) + self.assertFalse(self.world.get_location("Money Wrench").can_reach(max_cost_state)) + prog_shards = [] + for item in self.multiworld.itempool: + if "Time Shard " in item.name: + value = int(item.name.strip("Time Shard ()")) + if value >= 100: + prog_shards.append(item) + for shard in prog_shards: + max_cost_state.collect(shard, True) + self.assertTrue(self.world.get_location("Money Wrench").can_reach(max_cost_state)) From ef4d1e77e3eec4ce0c7a4fe381b18487aedc8b40 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Fri, 11 Oct 2024 23:24:42 +0200 Subject: [PATCH 3/9] Core: make shlex split an attempt with regular split retry (#4046) --- MultiServer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MultiServer.py b/MultiServer.py index 0fe950b5e4f3..8dfad5040de3 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -1153,7 +1153,10 @@ def __call__(self, raw: str) -> typing.Optional[bool]: if not raw: return try: - command = shlex.split(raw, comments=False) + try: + command = shlex.split(raw, comments=False) + except ValueError: # most likely: "ValueError: No closing quotation" + command = raw.split() basecommand = command[0] if basecommand[0] == self.marker: method = self.commands.get(basecommand[1:].lower(), None) From 2d0bdebaa9d58b5606dd60a773e45a3916658d71 Mon Sep 17 00:00:00 2001 From: gurglemurgle5 <95941332+gurglemurgle5@users.noreply.github.com> Date: Sat, 12 Oct 2024 19:01:28 -0500 Subject: [PATCH 4/9] Docs: Add ConnectUpdate to the list of client packets in the network protocol documentation #4045 --- docs/network protocol.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/network protocol.md b/docs/network protocol.md index 1c4579c4066f..4a96a43f818f 100644 --- a/docs/network protocol.md +++ b/docs/network protocol.md @@ -268,6 +268,7 @@ Additional arguments added to the [Set](#Set) package that triggered this [SetRe These packets are sent purely from client to server. They are not accepted by clients. * [Connect](#Connect) +* [ConnectUpdate](#ConnectUpdate) * [Sync](#Sync) * [LocationChecks](#LocationChecks) * [LocationScouts](#LocationScouts) From e8f3aa96dadef8651a05c0f070a1b8a361cb4eb9 Mon Sep 17 00:00:00 2001 From: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> Date: Sun, 13 Oct 2024 17:21:36 -0400 Subject: [PATCH 5/9] Timespinner: Two typos #4051 --- worlds/timespinner/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/timespinner/__init__.py b/worlds/timespinner/__init__.py index 66744cffdf85..f241d4468162 100644 --- a/worlds/timespinner/__init__.py +++ b/worlds/timespinner/__init__.py @@ -190,7 +190,7 @@ def write_spoiler_header(self, spoiler_handle: TextIO) -> None: if self.options.has_replaced_options: warning = \ - f"NOTICE: Timespinner options for player '{self.player_name}' where renamed from PasCalCase to snake_case, " \ + f"NOTICE: Timespinner options for player '{self.player_name}' were renamed from PascalCase to snake_case, " \ "please update your yaml" spoiler_handle.write("\n") From b772d42df56d915927919bb6d4176576c19d95c0 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Mon, 14 Oct 2024 00:15:53 +0200 Subject: [PATCH 6/9] Core: turn MultiServer item_names and location_names into instance vars (#4053) --- MultiServer.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/MultiServer.py b/MultiServer.py index 8dfad5040de3..bac35648cf5a 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -185,11 +185,9 @@ class Context: slot_info: typing.Dict[int, NetworkSlot] generator_version = Version(0, 0, 0) checksums: typing.Dict[str, str] - item_names: typing.Dict[str, typing.Dict[int, str]] = ( - collections.defaultdict(lambda: Utils.KeyedDefaultDict(lambda code: f'Unknown item (ID:{code})'))) + item_names: typing.Dict[str, typing.Dict[int, str]] item_name_groups: typing.Dict[str, typing.Dict[str, typing.Set[str]]] - location_names: typing.Dict[str, typing.Dict[int, str]] = ( - collections.defaultdict(lambda: Utils.KeyedDefaultDict(lambda code: f'Unknown location (ID:{code})'))) + location_names: typing.Dict[str, typing.Dict[int, str]] location_name_groups: typing.Dict[str, typing.Dict[str, typing.Set[str]]] all_item_and_group_names: typing.Dict[str, typing.Set[str]] all_location_and_group_names: typing.Dict[str, typing.Set[str]] @@ -198,7 +196,6 @@ class Context: """ each sphere is { player: { location_id, ... } } """ logger: logging.Logger - def __init__(self, host: str, port: int, server_password: str, password: str, location_check_points: int, hint_cost: int, item_cheat: bool, release_mode: str = "disabled", collect_mode="disabled", remaining_mode: str = "disabled", auto_shutdown: typing.SupportsFloat = 0, compatibility: int = 2, @@ -269,6 +266,10 @@ def __init__(self, host: str, port: int, server_password: str, password: str, lo self.location_name_groups = {} self.all_item_and_group_names = {} self.all_location_and_group_names = {} + self.item_names = collections.defaultdict( + lambda: Utils.KeyedDefaultDict(lambda code: f'Unknown item (ID:{code})')) + self.location_names = collections.defaultdict( + lambda: Utils.KeyedDefaultDict(lambda code: f'Unknown location (ID:{code})')) self.non_hintable_names = collections.defaultdict(frozenset) self._load_game_data() From d4d777b101f1759b0164181045cd7719d6b0d8ed Mon Sep 17 00:00:00 2001 From: Scipio Wright Date: Sun, 13 Oct 2024 18:17:53 -0400 Subject: [PATCH 7/9] OoT: Add aliases for Progressive Hookshot (#4052) * Add aliases for Progressive Hookshot * Update worlds/oot/__init__.py Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> --------- Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> --- worlds/oot/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/worlds/oot/__init__.py b/worlds/oot/__init__.py index b93f60b2a08e..c3925bf2a8bf 100644 --- a/worlds/oot/__init__.py +++ b/worlds/oot/__init__.py @@ -184,6 +184,10 @@ class OOTWorld(World): "Small Key Ring (Spirit Temple)", "Small Key Ring (Thieves Hideout)", "Small Key Ring (Water Temple)", "Boss Key (Fire Temple)", "Boss Key (Forest Temple)", "Boss Key (Ganons Castle)", "Boss Key (Shadow Temple)", "Boss Key (Spirit Temple)", "Boss Key (Water Temple)"}, + + # aliases + "Longshot": {"Progressive Hookshot"}, # fuzzy hinting thought Longshot was Slingshot + "Hookshot": {"Progressive Hookshot"}, # for consistency, mostly } location_name_groups = build_location_name_groups() From f2ac937d1e6d2964ab1f5951cdb54f47bdd96e78 Mon Sep 17 00:00:00 2001 From: Seafo <92278897+Seatori@users.noreply.github.com> Date: Sun, 13 Oct 2024 18:22:37 -0400 Subject: [PATCH 8/9] Minecraft: Fix plando connections #4048 Plando connections was broken as a result of https://github.com/ArchipelagoMW/Archipelago/pull/3765 This fixes it. --- worlds/minecraft/Structures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/minecraft/Structures.py b/worlds/minecraft/Structures.py index df3d944a6c65..d4f62f3498e9 100644 --- a/worlds/minecraft/Structures.py +++ b/worlds/minecraft/Structures.py @@ -29,7 +29,7 @@ def set_pair(exit, struct): # Connect plando structures first if self.options.plando_connections: - for conn in self.plando_connections: + for conn in self.options.plando_connections: set_pair(conn.entrance, conn.exit) # The algorithm tries to place the most restrictive structures first. This algorithm always works on the From 618564c60a1ae18d26d09688e08fc7df9e61dd8c Mon Sep 17 00:00:00 2001 From: Louis M Date: Mon, 14 Oct 2024 12:53:20 -0400 Subject: [PATCH 9/9] Aquaria: Adding slot data for poptracker (#4056) * Adds neccessary slot data for Aquaria * Comma oops --------- Co-authored-by: palex00 <32203971+palex00@users.noreply.github.com> --- worlds/aquaria/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/worlds/aquaria/__init__.py b/worlds/aquaria/__init__.py index 1fb04036d81b..dd17d09d8a6a 100644 --- a/worlds/aquaria/__init__.py +++ b/worlds/aquaria/__init__.py @@ -212,4 +212,8 @@ def fill_slot_data(self) -> Dict[str, Any]: "skip_first_vision": bool(self.options.skip_first_vision.value), "unconfine_home_water_energy_door": self.options.unconfine_home_water.value in [1, 3], "unconfine_home_water_transturtle": self.options.unconfine_home_water.value in [2, 3], + "bind_song_needed_to_get_under_rock_bulb": bool(self.options.bind_song_needed_to_get_under_rock_bulb), + "no_progression_hard_or_hidden_locations": bool(self.options.no_progression_hard_or_hidden_locations), + "light_needed_to_get_to_dark_places": bool(self.options.light_needed_to_get_to_dark_places), + "turtle_randomizer": self.options.turtle_randomizer.value, }