From eb924c14c2e70038fc55af69a9d3ed3b8d60626b Mon Sep 17 00:00:00 2001 From: Trysdyn Black Date: Wed, 9 Oct 2024 16:32:08 -0700 Subject: [PATCH] Change how we handle seed codes Rather than "normalize" seed codes to BCEX format (which causes issues with delimiter usage in some scenarios), leave the seed code alone and break its data out into fields that can/should be parsed instead. --- main.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index dd1acfc..f933698 100644 --- a/main.py +++ b/main.py @@ -234,13 +234,19 @@ def parse_SEED(data: str) -> dict[str, bool | str]: This is a fake section injected by the loader code. It contains nothing but the seed code and we derive from this if the randomizer is BCCE or - BCEX, and normalize the seed code to a standard format by undoing the - changes BCCE makes to it. - """ - # Normalize seed codes to BCEX format, removing spaces and replacing pipes with dots - seed = data.replace("|", ".").replace(" ", "") + BCEX, and try to pluck out other data. - return {"is_bcce": data.startswith("CE"), "seed": seed} + We can't do much because the format is really hard to reverse. + """ + version, mode, flags, seed_num = data.split("|") if "|" in data else data.split(".") + return { + "version": version, + "flags": flags, + "seed_num": seed_num, + "mode": mode, + "is_bcce": data.startswith("CE"), + "seed": data, + } def parse_SECRET_ITEMS(data: str) -> list[str]: