* MultiServer, customserver: move data package handling
Create a new class that handles conversion worlds+embedded -> context data.
Create a derived class that uses static_server_data+pony instead.
There is also a not very efficient feature to deduplicate strings (may need perf testing).
By moving code around, we can simplify a lot of the world loading.
Where code lines were touched, some typing and some reformatting was added.
The back compat for GetDataPackage without games was finally dropped.
This was done as a cleanup because the refactoring touched those lines anyway.
Also reworked the per-context dicts and the RoomInfo to hopefully be more efficient
by ignoring unused games. (Generating the list of used games was required for the new
code anyway.)
Side effect of the MultiServer cache: we now load worlds lazily (but still all at once)
and don't modify the games package in place. If needed we create copies.
This almost gets us to the point where MultiServer doesn't need worlds - it still needs
them for the forbidden items.
There is a bonus optimization that deduplicates strings in name_groups that may have bad
performance and may need some perf testing if we run into issues.
* MultiServer: fix string deduplication in data package cache
* MultiServer, customserver: minor formatting fixes
* MultiServer: fix data package cache for missing checksum case
* MultiServer: improve string deduplication in games package cache
* customserver: handle missing checksum in datapackage cache
* customserver: typing cleanup in games package cache
* Test, MultiServer, customser: add tests for games package cache
* Test, MultiServer: reorder imports
Hopefully this fixes the random test failures with pytest-xdist
* customserver: make WebHost import lazy in games package cache
and fix test
* customserver: games package cache: fix py3.11 compat
* MultiServer, customserver: cache: typing improvements
* customserver: cache: reformat
* Test: move customserver tests to not interfere with webhost
* MultiServer, customserver: cache: rename module
* Multiserver: better error message for missing Datapackage
* customserver: cache: invert if for readability
* customserver: optimize non_hintable_names
* Use an empty frozenset singleton
* Only include non-empty sets in static_server_data
* Only prefill dict with played games
This should save ~2-4KB per room and slightly speedup lookup.
---------
Co-authored-by: Fabian Dill <[email protected]>
* Add check for cosmic terminal and use different arguments if so
* Changed check for terminal to be strictly against executable name instead of path
based on this comment https://github.com/ArchipelagoMW/Archipelago/pull/6436#discussion_r3994140550
* Add `ptyxis` to list of moddern terminals
Co-authored-by: Duck <[email protected]>
* Changed `-e` terminal launch method to use `sh`
This standardizes the environment in which archipelago components launch and fixes launching with `zutty`
* Properly import pathlib
* Added comment detailing what `modern_terminals` is
* Refactored launching in terminal to new function in utils
* Optimised imports in Launcher.py
* Revert "Refactored launching in terminal to new function in utils"
This reverts commit 43367987da.
* Fixed unintentional cleanup in Utils.py
* Simplify check for terminals
Co-authored-by: Duck <[email protected]>
* Fully import pathlib
* Fix spelling mistake
* added gnome-terminal to list of modern_terminals
* added cosmic-term and ptyxis as fallback terminals
* Changed terminal search to add more terminal names easier
also included `alacritty` and `kitty`
* Check xterm terminal last
Also stores the list of terminals in tuples
Co-authored-by: black-sliver <[email protected]>
* Add type hint to terminal variable
Co-authored-by: black-sliver <[email protected]>
---------
Co-authored-by: Osiris32-and-a-half <[email protected]>
Co-authored-by: Duck <[email protected]>
Co-authored-by: black-sliver <[email protected]>
* Core: typing and cleaning, mostly in `Fill.py`
* fix typing of things we get out of plando blocks
* clean getting multiworld from kwargs
add a list type
clean indentation
* fix issues with merge conflict resolution
* some things found after merge
* move `gui_enabled` to Utils
* docstring
* If a user specified no-gui, don't use GUI messageboxes
---------
Co-authored-by: alwaysintreble <[email protected]>
* Improvements to visualize_regions for debugging GER usage
- allow the user to pass in a dict[int, int] to visualize_regions that maps Entrance.randomization_group to a color in RGB form. This allows for better visualization of which dangling entrances should match, or which matching groups are not being correctly respected.
- do full region visualization for unreached regions, so that entrances that could connect to new regions can be visualized.
- visualize unconnected entrances on regions, in addition to connected and unconnected exits, so that available ER targets can be visualized as well
* Add detail_disconnected_regions parameter to visualize_regions
* Rename detail_disconnected_regions to detail_other_regions for consistency
* Add auto_assign_colors param to visualize_regions
* Make auto assignment of entrance colors deterministic
* Assume show_other_regions is true if detail_other_regions is true
* Remove unused random import
* whitespace adjustments
* Move overflow check to prevent potential infinite loop
It wasn't exactly likely, as the user would have had to manually define all 4096 colors and then need an additional color on top of that, but accounting for that kind of nonsense is easy enough in this case.
* positive condition
---------
Co-authored-by: CodeGorilla <[email protected]>
* Core/Utils: Use correct env for save_filename from AppImage
* OptionsCreator: run export on a separate thread
Running a blocking call from kivy misbehaves on Linux.
This also changes '*.yaml' to '.yaml' for Utils.save_filename,
which is the correct way to call it.
* Core/Utils: destroy Tk root after save/open_filename
This allows using those functions from multiple threads.
Note that pure Tk apps should not use those functions from Utils.
* OptionsCreator: show snack when save_filename fails
* OptionsCreator: disable window while exporting
* OptionsCreator: fixing typing of added stuff
* Process all player files before reporting errors
Full tracebacks will still be in the console and in the logs, but this creates a relatively compact summary at the bottom.
* Include full typename in output
* Update module access and address style comments
* Annotate variables
* multi-errors: Revert to while loop
* Core: Handle each roll in its own try-catch
* multi-errors: Updated style and comments
* Undo accidental index change
* multi-errors: fix last remaining ref to erargs
* WebHost: reset Generator proc title on error
* WebHost: fix shutting down autogen
This is still not perfect but solves some of the issues.
* WebHost: properly propagate JOB_TIME
* WebHost: handle autogen shutdown
Adds support for a manifest file (archipelago.json) inside an .apworld file. It tells AP the game, minimum core version (optional field), maximum core version (optional field), its own version (used to determine which file to prefer to load only currently)
The file itself is marked as required starting with core 0.7.0, prior, just a warning is printed, with error trace.
Co-authored-by: Doug Hoskisson <[email protected]>
Co-authored-by: qwint <[email protected]>
Co-authored-by: Exempt-Medic <[email protected]>
Co-authored-by: NewSoupVi <[email protected]>
* Core: fix freeze support for py3.13+
Loading Utils now patches multiprocessing.freeze_support()
Utils.freeze_support() is now deprecated
* WebHost: use pony fork on py3.13
* CI: test with py3.13
moves uuid caching to appdata and uuid generation to be a random uuid instead of getnode's hardware address driven identifier and updates docs to point to the shared cache
* CounterOption
* bring back the negative exception for ItemDict
* Backwards compatibility
* ruff on witness
* fix in calls
* move the contains
* comment
* comment
* Add option min and max values for CounterOption
* Use min 0 for TrapWeights
* This is safe now
* ruff
* This fits on one line again now
* OptionCounter
* Update Options.py
* Couple more typing things
* Update Options.py
* Make StartInventory work again, also make LocationCounter theoretically work
* Docs
* more forceful wording
* forced line break
* Fix unit test (that wasn't breaking?)
* Add trapweights to witness option presets to 'prove' that the unit test passes
* Make it so you can order stuff
* Update macros.html