diff --git a/WebHostLib/customserver.py b/WebHostLib/customserver.py index 4ddf01edd1..cfc5de8164 100644 --- a/WebHostLib/customserver.py +++ b/WebHostLib/customserver.py @@ -2,7 +2,6 @@ from __future__ import annotations import functools import logging -import os import websockets import asyncio import socket @@ -20,6 +19,7 @@ from Utils import get_public_ipv4, get_public_ipv6, restricted_loads class CustomClientMessageProcessor(ClientMessageProcessor): ctx: WebHostContext + def _cmd_video(self, platform, user): """Set a link for your name in the WebHostLib tracker pointing to a video stream""" if platform.lower().startswith("t"): # twitch @@ -37,6 +37,7 @@ class CustomClientMessageProcessor(ClientMessageProcessor): # inject import MultiServer + MultiServer.client_message_processor = CustomClientMessageProcessor del (MultiServer) @@ -88,11 +89,11 @@ class WebHostContext(Context): threading.Thread(target=self.listen_to_db_commands, daemon=True).start() @db_session - def _save(self, exit_save:bool = False) -> bool: + def _save(self, exit_save: bool = False) -> bool: room = Room.get(id=self.room_id) room.multisave = pickle.dumps(self.get_save()) # saving only occurs on activity, so we can "abuse" this information to mark this as last_activity - if not exit_save: # we don't want to count a shutdown as activity, which would restart the server again + if not exit_save: # we don't want to count a shutdown as activity, which would restart the server again room.last_activity = datetime.utcnow() return True @@ -101,6 +102,7 @@ class WebHostContext(Context): d["video"] = [(tuple(playerslot), videodata) for playerslot, videodata in self.video.items()] return d + def get_random_port(): return random.randint(49152, 65535) diff --git a/WebHostLib/static/assets/tutorial/zelda3/multiworld_en.md b/WebHostLib/static/assets/tutorial/zelda3/multiworld_en.md index 737de947bd..5fc07cc18b 100644 --- a/WebHostLib/static/assets/tutorial/zelda3/multiworld_en.md +++ b/WebHostLib/static/assets/tutorial/zelda3/multiworld_en.md @@ -76,7 +76,7 @@ Firewall. 4. In the new window, click **Browse...** 5. Select the connector lua file included with your client - Z3Client users should download `sniConnector.lua` from the client download page - - SNIClient users should look in their Archipelago folder for `/sni/Connector.lua` + - SNIClient users should look in their Archipelago folder for `/sni/lua` ##### BizHawk 1. Ensure you have the BSNES core loaded. You may do this by clicking on the Tools menu in BizHawk and following @@ -85,10 +85,11 @@ Firewall. Once you have changed the loaded core, you must restart BizHawk. 2. Load your ROM file if it hasn't already been loaded. 3. Click on the Tools menu and click on **Lua Console** -4. Click the button to open a new Lua script. -5. Select the `sniConnector.lua` file you downloaded above +4. Click Script -> Open Scipt... +5. Select the `Connector.lua` file you downloaded above - Z3Client users should download `sniConnector.lua` from the client download page - - SNIClient users should look in their Archipelago folder for `/sni/Connector.lua` + - SNIClient users should look in their Archipelago folder for `/sni/lua` +6. Run the script by double clicking it in the listing #### With hardware This guide assumes you have downloaded the correct firmware for your device. If you have not