Commit Graph

8416 Commits

Author SHA1 Message Date
Uriel 62f56e165a add return type to weighted random 2026-03-07 18:10:44 -03:00
Uriel eebd83df76 fix while loop 2026-03-07 17:48:21 -03:00
Uriel 33f03387c4 this should check all usable ports before failing 2026-03-07 17:37:50 -03:00
Uriel 779dd46658 do it the duck way 2026-03-07 17:26:54 -03:00
Uriel 4ea7fbbcba only use ranges 2026-03-07 17:18:03 -03:00
Uriel 9ab7c56791 use a named tuple on parse_game_ports 2026-03-07 17:13:50 -03:00
Uriel e2823aa044 Apply suggestions from code review
Co-authored-by: Duck <31627079+duckboycool@users.noreply.github.com>
2026-03-07 16:52:57 -03:00
Uriel 368eafae86 fix random choices and move game_port conversion into tuple 2026-03-07 16:30:20 -03:00
Uriel 6779b4fcf3 fix last_used_ports not being updated locally 2026-03-07 15:09:53 -03:00
Uriel 6a94a9e6ca change game_ports to be tuple 2026-03-07 15:02:08 -03:00
Uriel c290386950 lazy init get_used_ports 2026-03-07 14:59:33 -03:00
Uriel 60773ddf83 rename variables and functions 2026-03-07 14:43:06 -03:00
Silvris 3ecd856e29 MultiServer: fix Windows compatibility (#6010) 2026-03-06 01:41:48 +01:00
Uriel 980a229aaa fix net_connections not working on macOS 2026-03-05 19:07:44 -03:00
black-sliver 2bec17b397 Merge branch 'main' into feat/data-package-cache 2026-03-05 21:24:50 +00:00
black-sliver 821645a881 MultiServer, customserver: cache: rename module 2026-03-05 22:17:10 +01:00
Uriel f03d1cad3e use weights for random port and remove more-itertools 2026-03-05 17:01:08 -03:00
Uriel 551dbf44f6 fix some reviews 2026-03-05 16:03:29 -03:00
Uriel 61f893437a Apply suggestions from code review
Co-authored-by: Duck <31627079+duckboycool@users.noreply.github.com>
2026-03-05 15:51:09 -03:00
Uriel 08a6ee2b3a fix port randomizer 2026-03-05 11:15:33 -03:00
Uriel b0615590fc add used ports cache and filter used ports when looking for ports 2026-03-05 10:34:33 -03:00
Uriel 0a0faefab2 reuse sockets with websockets api instead of opening and closing them 2026-03-05 09:53:23 -03:00
Uriel d6473fa0ed fix value type bug on ephemeral type 2026-03-05 08:42:09 -03:00
Uriel f8b730308d use yaml lists instead of string for config 2026-03-05 08:35:51 -03:00
Uriel 8800124c4e try fixing test with try 2026-03-05 08:08:45 -03:00
Uriel 88dc83e557 remove unused argument 2026-03-05 07:47:32 -03:00
Uriel ed77f58f13 fix what reviewers said and add some improvements 2026-03-05 07:42:33 -03:00
Uriel 9b098d6f6a Merge branch 'main' into custom-port-range 2026-03-05 05:16:44 -03:00
Silvris b372b02273 OptionCreator: 0.6.6 reported issues (#5949) 2026-03-04 19:47:30 +01:00
black-sliver f26313367e MultiServer: graceful shutdown for ctrl+c and sigterm (#5996) 2026-03-04 00:02:12 +01:00
Fabian Dill a3e8f69909 Core: introduce finalize_multiworld and pre_output stages (#5700)
Co-authored-by: Ishigh1 <bonjour940@yahoo.fr>
Co-authored-by: Duck <31627079+duckboycool@users.noreply.github.com>
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
2026-03-01 17:53:41 +01:00
Fabian Dill 922c7fe86a Core: allow async def functions as commands (#5859) 2026-03-01 17:51:56 +01:00
Duck e49ba2ff6f Undertale: Use check_locations helper to avoid redundant sends (#5993) 2026-03-01 01:30:26 +01:00
black-sliver 055acf4826 Test: move customserver tests to not interfere with webhost 2026-03-01 00:14:16 +00:00
Doug Hoskisson 61d5120f66 Core: use typing_extensions deprecated (#5989) 2026-03-01 00:14:33 +01:00
Chris W ff5402c410 Fix(undertale): prevent massive bounce msg spam for position updates (#5990)
* fix(undertale): prevent massive bounce msg spam for position updates

* make sure player is removed on leaving / timing out

* do not check for tags: online, as bounce evaluation is or'd
2026-02-28 22:56:28 +00:00
black-sliver 2ec4be6f1f customserver: cache: reformat 2026-02-28 21:02:34 +01:00
black-sliver 9996c12ef9 MultiServer, customserver: cache: typing improvements 2026-02-28 20:56:07 +01:00
black-sliver 1346a89a4a customserver: games package cache: fix py3.11 compat 2026-02-28 20:56:07 +01:00
black-sliver a294e1cdc9 customserver: make WebHost import lazy in games package cache
and fix test
2026-02-28 20:56:07 +01:00
black-sliver aad980a3a2 Test, MultiServer: reorder imports
Hopefully this fixes the random test failures with pytest-xdist
2026-02-28 19:19:27 +01:00
black-sliver 6f7fce9c73 Test, MultiServer, customser: add tests for games package cache 2026-02-28 15:36:17 +01:00
black-sliver 63bc205dab customserver: typing cleanup in games package cache 2026-02-28 15:35:24 +01:00
black-sliver 4a355f3585 customserver: handle missing checksum in datapackage cache 2026-02-28 15:34:58 +01:00
black-sliver 1cdd657068 MultiServer: improve string deduplication in games package cache 2026-02-28 15:34:10 +01:00
black-sliver f4ec119900 MultiServer: fix data package cache for missing checksum case 2026-02-27 01:32:56 +01:00
black-sliver 9c00b546dd MultiServer, customserver: minor formatting fixes 2026-02-27 01:24:52 +01:00
black-sliver 59051cda24 MultiServer: fix string deduplication in data package cache 2026-02-27 01:23:28 +01:00
black-sliver 9489a950cb 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.
2026-02-27 00:53:34 +01:00
black-sliver fcccbfca65 MultiServer: don't keep multidata alive for race_mode (#5980) 2026-02-26 18:31:39 +00:00