Commit Graph

1145 Commits

Author SHA1 Message Date
black-sliver
e8dc0dc592 Merge remote-tracking branch 'imurx/custom-port-range' into active/rc-site 2026-03-10 22:05:58 +01:00
black-sliver
e8f014fcc8 Merge branch 'feat/data-package-cache' into active/rc-site 2026-03-10 22:00:09 +01:00
black-sliver
89085ea7b8 Mark WebHost as beta 2026-03-10 21:56:50 +01:00
black-sliver
3235863f2e WebHost: add stats show cli command (#5995)
Usage: flask -A "WebHost:get_app()" stats show

Currently only shows sum and top10 biggest games packages.
2026-03-10 19:57:04 +01:00
josephwhite
4b37283d22 WebHost: Update UTC datetime usage (timezone-naive) (#4906) 2026-03-10 18:57:48 +01:00
Uriel
d57b3078b5 use generator expressions 2026-03-09 16:41:17 -03:00
Uriel
baad3ceede Update WebHostLib/customserver.py
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
2026-03-09 16:33:54 -03:00
Uriel
805b978403 Apply suggestions from code review
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
2026-03-09 13:55:34 -03:00
Uriel
aff006a85f Update WebHostLib/customserver.py
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
2026-03-09 07:00:44 -03:00
Uriel
2725720406 reformat file and change create_random_port_socket test 2026-03-08 07:01:29 -03:00
Uriel
10d2908339 add tests 2026-03-08 06:32:22 -03:00
Uriel
9653c8d29c simplify tuple conversion check 2026-03-07 22:50:04 -03:00
Uriel
62afec9733 Update WebHostLib/customserver.py
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
2026-03-07 22:24:13 -03:00
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
Uriel
980a229aaa fix net_connections not working on macOS 2026-03-05 19:07:44 -03: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
black-sliver
9c00b546dd MultiServer, customserver: minor formatting fixes 2026-02-27 01:24:52 +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
DrAwesome4333
699ca8adf6 WebHost: Add CORS headers to API Endpoints (#5777) 2026-02-25 02:47:54 +01:00
Fabian Dill
d83da1b818 WebHost: memory leak fixes (#5966) 2026-02-22 21:22:22 +01:00
josephwhite
f2a6a769b0 Webhost: Fix defaults for NamedRange and TextChoice (#5139) 2026-02-15 17:46:40 +01:00
black-sliver
9b421450b1 Doc: WebHost: update readme and style guide (#4853)
* Doc: WebHost living standard

* Docs: update style guide for HTML, CSS and JS

* Unblame phar

* Too many words

* The better choice

* More rules

* Removed too much

* Docs: add recommendations for script defer and async
2026-01-28 20:57:12 +01:00
black-sliver
8dee460397 customserver: don't set last_activity that will be overwritten later (#5844) 2026-01-17 13:46:20 +01:00
Remy Jette
cda54e0bea WebHost: Fix world sorting in /tutorial/ (#5785) 2026-01-15 22:21:44 +01:00
Fabian Dill
01e1e1fe11 WebHost: increase form upload limit (#5756) 2025-12-17 19:12:10 +01:00
Fabian Dill
4a0a65d604 WebHost: add played game to static tracker (#5731) 2025-12-09 00:45:02 +01:00
Duck
0905e3ce32 WebHost/Game Guides: Change links to stay on current instance (#5699)
* Remove absolute links to archipelago.gg

* Fix other link issues
2025-12-02 00:40:05 +01:00