-
Notifications
You must be signed in to change notification settings - Fork 705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core: add correct flags to precollected items #2059
Conversation
Co-authored-by: Aaron Wagener <[email protected]>
With only looking at it, and not testing it, I'm pretty sure this will fail to load old multidata files. |
Tested it, and the flags work correctly on receipt, but yeah it does fail to load old multidata. |
Im not sure if this is the greatest way to do it. If not can I get some info on a better way? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generating a seed with this and uploading to archipelago.gg will fail as well. You would have to bump the version to 0.4.5 and set multidata's ["minimum_versions"]["server"]
to 0.4.5.
I would instead suggest adding decoded_obj["precollected_flags"]
and use zip()
to iterate over both items and flags at the same time.
--
also this has conflicts now :(
--
i would like to have this in 0.4.5 fwiw
# Conflicts: # Main.py
This doesn't fail when you upload to archipelago.gg but the TODO was outdated for sure 😐
I'm not quite sure what you mean with doing this |
I have not tested it, but if items and isinstance(items[0], tuple): this code does not exist on current archipelago.gg, so by generating a multidata that has a tuple there, the current WebHost will run the old code path, which does self.start_inventory[slot] = [NetworkItem(item_code, -2, 0) for item_code in item_codes] where item_code is now a tuple instead of a number, breaking the game. The way to solve this imo is by providing two separate entries in the multidata: for slot, items in decoded_obj["precollected_items"].items():
for item_code, item_flags in zip_longest(items, decoded_obj.get("precollected_flags", {}).get(slot, []), fillvalue=0):
... |
What is this fixing or adding?
precollected items just had a default flag
How was this tested?
ran generate and multiserver to test the changes
Why I added this
While the flags aren't being used anywhere at the moment I am working on a web based text client that I would like to use the flags to correctly color the precollected items. I think the Archipelago tracker could eventually use this information as well.