* 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]>
* Correct Bounce Target logic, write unit tests
tmp
* that is not correct
* What was I smoking
* explicitly document None
* What was I smoking
* fix weakref syntax
* ruff
* fix magicmoc
* Address Berserker's comments
* comment
* consistently use self.assertEqual
* make slot 2 on team 3 not use deathlink to test different tags for the same slot on different teams
* Improve error message
* Allow 'and' concatenation of bounce packet conditions
* Docs + small change
* Docs stuff
* update Bounced as well
* lol
* shadowing issue
* Slight rework to allow teams
* teams note
* Make the PR ready
* docs further up too
* Let's not do this actually
* Use operator & don't redefine functions
* team default
* remove unnecessarily added whitespace
* core: Add host.yaml setting to make !countdown configurable
* Store /option changes to countdown_mode in save file
* Wording changes in host.yaml
* Use .get
* Fix validation for /option command
* CreateHint command
* Docs
* oops
* forgot an arg
* Update MultiServer.py
* Add documentation on what happens when the hint already exists but with a different status (nothing)
* Early exit if no locations provided
* Add a clarifying comment to the code as well
* change wording a bit
Basically, hints for itemlink worlds' locations get stored in ctx.hints under
1. the location's player
2. **every individual player** that is participating in the itemlink.
Right now, the updatehint code tries to replace and resend the hint under the itemlinked player, which doesn't work.
* MultiServer: add NoText tag and handling
* MultiServer: deprecate and warn for uncompressed connections
* MultiServer: fix missing space in no compression warning
* Vi don't forget about itemlinks challenge difficulty impossible
* People other than Vi also don't forget about ItemLinks challenge difficulty impossible
* Introduce 'Hint Priority' concept
* fix error when sorting hints while not connected
* fix 'found' -> 'status' kivy stuff
* remove extraneous warning
this warning fired if you clicked to select or toggle priority of any hint, as you weren't clicking on the header...
* skip scanning individual header widgets when not clicking on the header
* update hints on disconnection
* minor cleanup
* minor fixes/cleanup
* fix: hints not updating properly for receiving player
* update re: review
* 'type() is' -> 'isinstance()'
* cleanup, re: Jouramie's review
* Change 'priority' to 'status', add 'Unspecified' and 'Avoid' statuses, update colors
* cleanup
* move dicts out of functions
* fix: new hints being returned when hint already exists
* fix: show `Found` properly when hinting already-found hints
* import `Hint` and `HintStatus` directly from `NetUtils`
* Default any hinted `Trap` item to be classified as `Avoid` by default
* add some sanity checks
* re: Vi's feedback
* move dict out of function
* Update kvui.py
* remove unneeded dismiss message
* allow lclick to drop hint status dropdown
* underline hint statuses to indicate clickability
* only underline clickable statuses
* Update kvui.py
* Update kvui.py
---------
Co-authored-by: Silvris <[email protected]>
Co-authored-by: NewSoupVi <[email protected]>
* Core: downgrade websockets to 13.x
14.x currently doesn't work for MultiServer.
14.x is not supported with py3.8, so updating to 14.x should be scheduled for AP 0.6.0.
* CI: 5min timeout for hosting test
* MultiServer: properly shutdown even if ctx is invalid
* CI: increase hosting test timeout to 10min
this is 4x expected time, just to be safe.