* Added ability to define custom port ranges the WebHost will use for game servers, instead of pure random.
* - Added better fallback to default port range when a custom range fails
- Updated config to be clearer
* Added ability to define custom port ranges the WebHost will use for game servers, instead of pure random.
* - Added better fallback to default port range when a custom range fails
- Updated config to be clearer
* Updated soft-fail message
* Removed dead import from customserver.py
* Update requirements.txt
Settings requirements to main core branch
* fix what reviewers said and add some improvements
* remove unused argument
* try fixing test with try
* use yaml lists instead of string for config
* fix value type bug on ephemeral type
* reuse sockets with websockets api instead of opening and closing them
* add used ports cache and filter used ports when looking for ports
* fix port randomizer
* Apply suggestions from code review
Co-authored-by: Duck <31627079+duckboycool@users.noreply.github.com>
* fix some reviews
* use weights for random port and remove more-itertools
* fix net_connections not working on macOS
* rename variables and functions
* lazy init `get_used_ports`
* change `game_ports` to be `tuple`
* fix last_used_ports not being updated locally
* fix random choices and move game_port conversion into tuple
* Apply suggestions from code review
Co-authored-by: Duck <31627079+duckboycool@users.noreply.github.com>
* use a named tuple on parse_game_ports
* only use ranges
* do it the duck way
* this should check all usable ports before failing
* fix while loop
* add return type to weighted random
* Update WebHostLib/customserver.py
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* simplify tuple conversion check
* add tests
* reformat file and change `create_random_port_socket` test
* add more test cases for parse_game_ports
* try to prevent busy-looping on create random port socket when doing test
* simplify parse game port tests to one assertListEqual
* make the range lesser for port test
* reduce range on macOS
* Apply suggestions from code review
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* Update WebHostLib/customserver.py
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* remove unused import
* Update WebHostLib/customserver.py
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* use generator expressions
* check for 0-tuple
* use some kind of shuffled queue
* update tests
* refactor new port handling into a class (#1)
* change time to monotonic
* Update docs/webhost configuration sample.yaml
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* add psutil 7.2.2 as requirement
* Update WebHostLib/requirements.txt
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
---------
Co-authored-by: Lexipherous <jasonnlelong@gmail.com>
Co-authored-by: Duck <31627079+duckboycool@users.noreply.github.com>
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* WebHost: disallow '=' and whitespace in SUUID and append the correct number of '='
This makes Room IDs unambiguous and avoids breaking if b64decode ever becomes strict.
* Tests, WebHost: add SUUID tests
* Tests, WebHost: add edge cases to SUUID tests
* 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
* Multiple: resize FR RA network commands screenshot
This is now more in line with the text (and the english version).
* Multiple: optimize EN RA network commands screenshot
The URL has changed, so it's a good time to optimize.
* WebHost, Worlds: fix retroarch images not showing
Implements a src/url replacement for relative paths.
Moves the RA screenshots to worlds/generic since they are shared.
Also now uses the FR version in ffmq.
Also fixes the formatting that resultet in the list breaking.
Also moves imports in render_markdown.
Guides now also properly render on Github.
* Factorio: optimize screenshots
The URL has changed, so it's a good time to optimize.
* Factorio: change guide screenshots to use relative URL
* Test: markdown: fix tests on Windows
We also can't use delete=True, delete_on_close=False
because that's not supported in Py3.11.
* Test: markdown: fix typo
I hope that's it now. *sigh*
* Landstalker: fix doc images not showing
Change to relative img urls.
* Landstalker: optimize doc PNGs
The URL has changed, so it's a good time to optimize.
... and update it to latest.
This is being used in WebHostLib.options directly.
A recent change bumped our required version, so this is actually a fix.
* Fix webhost argparse with extra args
* accidentally added line
* WebHost: fix some typing
B64 url conversion is used in test/hosting,
so it felt appropriate to include this here.
* Test: Hosting: also test autogen
* Test: Hosting: simplify stop_* and leave a note about Windows compat
* Test: Hosting: fix formatting error
* Test: Hosting: add limitted Windows support
There are actually some differences with MP on Windows
that make it impossible to run this in CI.
---------
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
From Discord:
Well, flask-compress updated and now our 3.11 CI is failing
Why? They switched to a lib called backports.zstd
And 3.11 pkg_resources can't handle that.
pip finds it. But in our ModuleUpdate.py, we first pkg_resources.require packages, and this fails. I can't reproduce this locally yet, but in CI, it seems like even though backports.zstd is installed, it still fails on it and prompts installing it over and over in every unit test
Now what do we do :KEKW:
Black Sliver suggested pinning flask-compress for 3.11
But I would just like to point out that this means we can't unpin it until we drop 3.11
the real thing is we probably need to move away from pkg_resources? lol
since it's been deprecated literally since the oldest version we support
* 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
* 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
* Improve user friendliness of generation failure webpage.
* Add details to other render for seedError.html.
* Refactor css to avoid !important tags.
* Update WebHostLib/static/styles/themes/ocean-island.css
Co-authored-by: qwint <qwint.42@gmail.com>
* Update WebHostLib/generate.py
Co-authored-by: qwint <qwint.42@gmail.com>
* use f words
* small refactor
* Update WebHostLib/generate.py
Co-authored-by: qwint <qwint.42@gmail.com>
* Fix whitespace.
* Update one new use of seedError template for pickling errors.
---------
Co-authored-by: qwint <qwint.42@gmail.com>