Commit Graph

99 Commits

Author SHA1 Message Date
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
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
Fabian Dill
d83da1b818 WebHost: memory leak fixes (#5966) 2026-02-22 21:22:22 +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
black-sliver
e907980ff0 MultiServer: slight optimizations (#5527)
* Core: optimize MultiServer.Client

* Core: optimize websocket compression settings
2025-10-08 02:22:34 +02:00
black-sliver
91e97b68d4 Webhost: eagerly free resources in customserver (#5512)
* Unref some locals that would live long for no reason.
* Limit scope of db_session in init_save.
2025-10-05 03:49:56 +02:00
Duck
a36e6259f1 Core: Add restricted_dumps helper (#5117)
* Add pickling helper that check unpicklability

* Add test condition and generation error handling

* Fix incorrect call and make imports consistent

* Fix newline padding

* Change PicklingError to directly caused by UnpicklingError

Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>

* Revert to `pickle.dumps` for decompressed multidata

* Fix import order

* Restore pickle import in main

* Re-add for multidata in Main

* Remove multisave checks

* Update MultiServer.py

* Update customserver.py

---------

Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
2025-07-26 23:01:40 +02:00
black-sliver
63fbcc5fc8 WebHost: custom proc title for Generator and MultiHoster (#4310)
* WebHost: custom proctitle for Generator and MultiHoster

* Update setproctitle to 1.3.5
2025-04-06 13:50:24 +02:00
Fabian Dill
cad217af19 Core: update cert file daily in customserver.py (#4454) 2025-04-06 05:31:14 +02:00
Lexipherous
60f6f0f8a8 Merge branch 'main' into main 2025-03-21 09:57:36 +00:00
NewSoupVi
b7fc96100c Revert "Core: update websockets (#4732)" (#4753)
This reverts commit 42eaeb92f0.
2025-03-19 01:39:18 +01:00
Lexipherous
16b47b0a7f Merge branch 'main' into main 2025-03-18 16:13:59 +00:00
lexipherous
41b0c7edc6 Removed dead import from customserver.py 2025-03-18 16:06:48 +00:00
Fabian Dill
42eaeb92f0 Core: update websockets (#4732) 2025-03-16 22:13:12 +01:00
black-sliver
8349774c5c customserver: ignore static datapackage optimization for old games (#4650) 2025-02-16 23:51:36 +01:00
Lexipherous
4d5853d8e3 Merge branch 'main' into HEAD
# Conflicts:
#	WebHostLib/autolauncher.py
#	WebHostLib/customserver.py
2025-02-09 17:45:26 +00:00
black-sliver
1a41e1acc8 customserver: fix memory leak (#3864) 2024-09-01 20:34:50 +02:00
black-sliver
948f50f35d customserver: fix minor memory leak (#3636)
Old code keeps ref to last started room's task and thus never fully cleans it up.
2024-07-14 13:56:56 +02:00
black-sliver
187f9dac94 customserver: preemtively run GC before starting room (#3637)
GC seems to be lazy.
2024-07-14 13:56:27 +02:00
black-sliver
afb6d9c4da MultiServer, customserver, CI, Test: Fix problems in room hosting and test/simulate it (#3464)
* Test: add hosting simulation test

* WebHost: add weak typing to get_app()

* MultiServer: add typing to auto_saver_thread

* MultiServer: don't cancel task, properly end it

* customserver: stop auto-save thread from saving after shutdown

and make sure it stops, another potential memory leak

* MultiServer, customserver: make datapackage small again

* customserver: collect/finish room tasks

Hopefully fixes the memory leak we are seeing

* CI: test hosting

* Test: hosting: verify autohoster saves on Ctrl+C

* customserver: save when stopping via Ctrl+C
2024-06-06 01:54:46 +02:00
black-sliver
6f6bf3c62d CustomServer: properly 'inherit' Archipelago from static_server_data (#3366)
This fixes a potential exception during room spin-up.
2024-05-30 18:16:13 +02:00
Fabian Dill
461f5db35a Customserver: only save on exit if it's in a good state. (#3351) 2024-05-21 14:08:59 +02:00
black-sliver
019dfb8242 CustomServer: re-add missing Archipelago to data package (#3341) 2024-05-19 20:40:08 +02:00