LttP Docs: reword instructions to not accidentally overwrite the SNI Connector with an empty file.

This commit is contained in:
Fabian Dill 2021-12-03 07:01:21 +01:00
parent a3220ac72d
commit e7d8149d74
2 changed files with 10 additions and 7 deletions

View File

@ -2,7 +2,6 @@ from __future__ import annotations
import functools import functools
import logging import logging
import os
import websockets import websockets
import asyncio import asyncio
import socket import socket
@ -20,6 +19,7 @@ from Utils import get_public_ipv4, get_public_ipv6, restricted_loads
class CustomClientMessageProcessor(ClientMessageProcessor): class CustomClientMessageProcessor(ClientMessageProcessor):
ctx: WebHostContext ctx: WebHostContext
def _cmd_video(self, platform, user): def _cmd_video(self, platform, user):
"""Set a link for your name in the WebHostLib tracker pointing to a video stream""" """Set a link for your name in the WebHostLib tracker pointing to a video stream"""
if platform.lower().startswith("t"): # twitch if platform.lower().startswith("t"): # twitch
@ -37,6 +37,7 @@ class CustomClientMessageProcessor(ClientMessageProcessor):
# inject # inject
import MultiServer import MultiServer
MultiServer.client_message_processor = CustomClientMessageProcessor MultiServer.client_message_processor = CustomClientMessageProcessor
del (MultiServer) del (MultiServer)
@ -88,11 +89,11 @@ class WebHostContext(Context):
threading.Thread(target=self.listen_to_db_commands, daemon=True).start() threading.Thread(target=self.listen_to_db_commands, daemon=True).start()
@db_session @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 = Room.get(id=self.room_id)
room.multisave = pickle.dumps(self.get_save()) room.multisave = pickle.dumps(self.get_save())
# saving only occurs on activity, so we can "abuse" this information to mark this as last_activity # 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() room.last_activity = datetime.utcnow()
return True return True
@ -101,6 +102,7 @@ class WebHostContext(Context):
d["video"] = [(tuple(playerslot), videodata) for playerslot, videodata in self.video.items()] d["video"] = [(tuple(playerslot), videodata) for playerslot, videodata in self.video.items()]
return d return d
def get_random_port(): def get_random_port():
return random.randint(49152, 65535) return random.randint(49152, 65535)

View File

@ -76,7 +76,7 @@ Firewall.
4. In the new window, click **Browse...** 4. In the new window, click **Browse...**
5. Select the connector lua file included with your client 5. Select the connector lua file included with your client
- Z3Client users should download `sniConnector.lua` from the client download page - 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 ##### BizHawk
1. Ensure you have the BSNES core loaded. You may do this by clicking on the Tools menu in BizHawk and following 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. Once you have changed the loaded core, you must restart BizHawk.
2. Load your ROM file if it hasn't already been loaded. 2. Load your ROM file if it hasn't already been loaded.
3. Click on the Tools menu and click on **Lua Console** 3. Click on the Tools menu and click on **Lua Console**
4. Click the button to open a new Lua script. 4. Click Script -> Open Scipt...
5. Select the `sniConnector.lua` file you downloaded above 5. Select the `Connector.lua` file you downloaded above
- Z3Client users should download `sniConnector.lua` from the client download page - 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 #### With hardware
This guide assumes you have downloaded the correct firmware for your device. If you have not This guide assumes you have downloaded the correct firmware for your device. If you have not