diff --git a/FactorioClient.py b/FactorioClient.py index b7bf324311..2fa8ba9c15 100644 --- a/FactorioClient.py +++ b/FactorioClient.py @@ -400,6 +400,7 @@ if __name__ == '__main__': "Refer to Factorio --help for those.") parser.add_argument('--rcon-port', default='24242', type=int, help='Port to use to communicate with Factorio') parser.add_argument('--rcon-password', help='Password to authenticate with RCON.') + parser.add_argument('--server-settings', help='Factorio server settings configuration file.') args, rest = parser.parse_known_args() colorama.init() @@ -410,6 +411,9 @@ if __name__ == '__main__': factorio_server_logger = logging.getLogger("FactorioServer") options = Utils.get_options() executable = options["factorio_options"]["executable"] + server_settings = args.server_settings if args.server_settings else options["factorio_options"].get("server_settings", None) + if server_settings: + server_settings = os.path.abspath(server_settings) if not os.path.exists(os.path.dirname(executable)): raise FileNotFoundError(f"Path {os.path.dirname(executable)} does not exist or could not be accessed.") @@ -421,7 +425,10 @@ if __name__ == '__main__': else: raise FileNotFoundError(f"Path {executable} is not an executable file.") - server_args = ("--rcon-port", rcon_port, "--rcon-password", rcon_password, *rest) + if server_settings and os.path.isfile(server_settings): + server_args = ("--rcon-port", rcon_port, "--rcon-password", rcon_password, "--server-settings", server_settings, *rest) + else: + server_args = ("--rcon-port", rcon_port, "--rcon-password", rcon_password, *rest) asyncio.run(main(args)) colorama.deinit() diff --git a/Utils.py b/Utils.py index 423bb3b469..4d3d6b134b 100644 --- a/Utils.py +++ b/Utils.py @@ -479,9 +479,13 @@ def init_logging(name: str, loglevel: typing.Union[str, int] = logging.INFO, wri def stream_input(stream, queue): def queuer(): while 1: - text = stream.readline().strip() - if text: - queue.put_nowait(text) + try: + text = stream.readline().strip() + except UnicodeDecodeError as e: + logging.exception(e) + else: + if text: + queue.put_nowait(text) from threading import Thread thread = Thread(target=queuer, name=f"Stream handler for {stream.name}", daemon=True) diff --git a/WebHostLib/requirements.txt b/WebHostLib/requirements.txt index c9ee8620ce..52d0316b2a 100644 --- a/WebHostLib/requirements.txt +++ b/WebHostLib/requirements.txt @@ -1,7 +1,7 @@ -flask>=2.1.2 +flask>=2.1.3 pony>=0.7.16 waitress>=2.1.1 -Flask-Caching>=2.0.0 +Flask-Caching>=2.0.1 Flask-Compress>=1.12 Flask-Limiter>=2.5.0 -bokeh>=2.4.3 \ No newline at end of file +bokeh>=2.4.3 diff --git a/host.yaml b/host.yaml index 86f88de024..901e6cd727 100644 --- a/host.yaml +++ b/host.yaml @@ -101,7 +101,9 @@ sm_options: # Alternatively, a path to a program to open the .sfc file with rom_start: true factorio_options: - executable: "factorio\\bin\\x64\\factorio" + executable: "factorio/bin/x64/factorio" + # by default, no settings are loaded if this file does not exist. If this file does exist, then it will be used. + # server_settings: "factorio\\data\\server-settings.json" minecraft_options: forge_directory: "Minecraft Forge server" max_heap_size: "2G" diff --git a/worlds/factorio/__init__.py b/worlds/factorio/__init__.py index 33f1809cf7..9dc1febcba 100644 --- a/worlds/factorio/__init__.py +++ b/worlds/factorio/__init__.py @@ -221,7 +221,7 @@ class Factorio(World): # Return the liquid to the pool and get a new ingredient. pool.append(new_ingredient) new_ingredient = pool.pop(0) - liquids_used += 1 + liquids_used += 1 if new_ingredient in fluids else 0 new_ingredients[new_ingredient] = 1 return Recipe(original.name, self.get_category(original.category, liquids_used), new_ingredients, original.products, original.energy) diff --git a/worlds/hk/__init__.py b/worlds/hk/__init__.py index c07d995ecd..bc9b29519e 100644 --- a/worlds/hk/__init__.py +++ b/worlds/hk/__init__.py @@ -121,6 +121,7 @@ shop_cost_types: typing.Dict[str, typing.Tuple[str, ...]] = { "Leg_Eater": ("GEO",), } + class HKWeb(WebWorld): tutorials = [Tutorial( "Mod Setup and Use Guide", @@ -131,6 +132,8 @@ class HKWeb(WebWorld): ["Ijwu"] )] + bug_report_page = "https://github.com/Ijwu/Archipelago.HollowKnight/issues/new?assignees=&labels=bug%2C+needs+investigation&template=bug_report.md&title=" + class HKWorld(World): """Beneath the fading town of Dirtmouth sleeps a vast, ancient kingdom. Many are drawn beneath the surface, diff --git a/worlds/witness/WitnessLogic.txt b/worlds/witness/WitnessLogic.txt index a4cdd9f1c4..71ca7c819f 100644 --- a/worlds/witness/WitnessLogic.txt +++ b/worlds/witness/WitnessLogic.txt @@ -765,7 +765,9 @@ Inside Mountain Second Layer (Inside Mountain) - Inside Mountain Second Layer Li 158430 - 0x09FD8 (Color Cycle 5) - 0x09FD7 - Color Cycle & RGB & Squares & Colored Squares & Symmetry & Colored Dots Door - 0x09FFB (Staircase Near) - 0x09FD8 -Inside Mountain Second Layer Blue Bridge (Inside Mountain) - Inside Mountain Second Layer Beyond Bridge - TrueOneWay - Inside Mountain Second Layer Elevator Room - 0x09EDD: +Inside Mountain Second Layer Blue Bridge (Inside Mountain) - Inside Mountain Second Layer Beyond Bridge - TrueOneWay - Inside Mountain Second Layer At Door - TrueOneWay: + +Inside Mountain Second Layer At Door (Inside Mountain) - Inside Mountain Second Layer Elevator Room - 0x09EDD: Door - 0x09EDD (Door to Elevator) - 0x09ED8 & 0x09E86 Inside Mountain Second Layer Light Bridge Room Near (Inside Mountain):