From 4b6f80dd122e20303d96fa55ec606c473c9b5e8f Mon Sep 17 00:00:00 2001 From: Berserker66 Date: Sat, 11 Jul 2020 16:21:10 +0200 Subject: [PATCH 1/9] Webhost: remove redis requirement as it as was not chosen due to windows incompatibility --- WebHost/requirements.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/WebHost/requirements.txt b/WebHost/requirements.txt index 0e14504f..d82c5314 100644 --- a/WebHost/requirements.txt +++ b/WebHost/requirements.txt @@ -3,6 +3,4 @@ pony>=0.7.13 waitress>=1.4.4 flask-caching>=1.9.0 Flask-Autoversion>=0.2.0 -Flask-Compress>=1.5.0 -redis>=3.5.3 -rq>=1.4.3 \ No newline at end of file +Flask-Compress>=1.5.0 \ No newline at end of file From cf5e404aa6c098417de488be9326719bfa3384fe Mon Sep 17 00:00:00 2001 From: Berserker66 Date: Sat, 11 Jul 2020 16:25:06 +0200 Subject: [PATCH 2/9] Webhost: Fix autohost lock on unix --- WebHost/autolauncher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WebHost/autolauncher.py b/WebHost/autolauncher.py index ffbad87f..dcfc4634 100644 --- a/WebHost/autolauncher.py +++ b/WebHost/autolauncher.py @@ -45,8 +45,8 @@ else: # unix class Locker(CommonLocker): def __enter__(self): - self.fp = open(self.lockfile, "rb") try: + self.fp = open(self.lockfile, "wb") fcntl.flock(self.fp.fileno(), fcntl.LOCK_EX) except OSError as e: raise AlreadyRunningException() from e @@ -72,6 +72,7 @@ def autohost(config: dict): def keep_running(): try: with Locker("autohost"): + logging.info("Starting autohost service") # db.bind(**config["PONY"]) # db.generate_mapping(check_tables=False) while 1: From b06f528f72a018bac1e3d6d7b14f8f68b1c8bc73 Mon Sep 17 00:00:00 2001 From: Berserker66 Date: Sat, 11 Jul 2020 16:54:38 +0200 Subject: [PATCH 3/9] Fix ModuleUpdater fallback patch --- ModuleUpdate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModuleUpdate.py b/ModuleUpdate.py index abae05c4..e8abef64 100644 --- a/ModuleUpdate.py +++ b/ModuleUpdate.py @@ -19,7 +19,7 @@ def update(): update_ran = True path = os.path.join(os.path.dirname(sys.argv[0]), 'requirements.txt') if not os.path.exists(path): - os.path.join(os.path.dirname(__file__), 'requirements.txt') + path = os.path.join(os.path.dirname(__file__), 'requirements.txt') with open(path) as requirementsfile: for line in requirementsfile.readlines(): module, remote_version = line.split(">=") From cdee9e5a3a3f9fb7f0ec0a8f6caecd4ac788f204 Mon Sep 17 00:00:00 2001 From: Berserker66 Date: Sat, 11 Jul 2020 16:59:37 +0200 Subject: [PATCH 4/9] WebHost: Move module into WebHostLib to prevent shadowing WebHost.py --- WebHost.py | 6 +++--- {WebHost => WebHostLib}/__init__.py | 2 +- {WebHost => WebHostLib}/autolauncher.py | 0 {WebHost => WebHostLib}/customserver.py | 6 +++--- {WebHost => WebHostLib}/landing.py | 2 +- {WebHost => WebHostLib}/models.py | 0 {WebHost => WebHostLib}/requirements.txt | 0 {WebHost => WebHostLib}/static/jquery.scrollsync.js | 0 {WebHost => WebHostLib}/static/static.css | 0 {WebHost => WebHostLib}/templates/host_room.html | 0 {WebHost => WebHostLib}/templates/landing.html | 0 {WebHost => WebHostLib}/templates/layout.html | 0 {WebHost => WebHostLib}/templates/macros.html | 0 {WebHost => WebHostLib}/templates/tracker.html | 0 {WebHost => WebHostLib}/templates/uploads.html | 0 {WebHost => WebHostLib}/templates/view_seed.html | 0 {WebHost => WebHostLib}/tracker.py | 2 +- {WebHost => WebHostLib}/upload.py | 2 +- 18 files changed, 10 insertions(+), 10 deletions(-) rename {WebHost => WebHostLib}/__init__.py (98%) rename {WebHost => WebHostLib}/autolauncher.py (100%) rename {WebHost => WebHostLib}/customserver.py (96%) rename {WebHost => WebHostLib}/landing.py (82%) rename {WebHost => WebHostLib}/models.py (100%) rename {WebHost => WebHostLib}/requirements.txt (100%) rename {WebHost => WebHostLib}/static/jquery.scrollsync.js (100%) rename {WebHost => WebHostLib}/static/static.css (100%) rename {WebHost => WebHostLib}/templates/host_room.html (100%) rename {WebHost => WebHostLib}/templates/landing.html (100%) rename {WebHost => WebHostLib}/templates/layout.html (100%) rename {WebHost => WebHostLib}/templates/macros.html (100%) rename {WebHost => WebHostLib}/templates/tracker.html (100%) rename {WebHost => WebHostLib}/templates/uploads.html (100%) rename {WebHost => WebHostLib}/templates/view_seed.html (100%) rename {WebHost => WebHostLib}/tracker.py (99%) rename {WebHost => WebHostLib}/upload.py (98%) diff --git a/WebHost.py b/WebHost.py index 88e994bf..ce42fcd8 100644 --- a/WebHost.py +++ b/WebHost.py @@ -2,11 +2,11 @@ import os import multiprocessing import logging -from WebHost import app as raw_app +from WebHostLib import app as raw_app from waitress import serve -from WebHost.models import db -from WebHost.autolauncher import autohost +from WebHostLib.models import db +from WebHostLib.autolauncher import autohost configpath = "config.yaml" diff --git a/WebHost/__init__.py b/WebHostLib/__init__.py similarity index 98% rename from WebHost/__init__.py rename to WebHostLib/__init__.py index be56d2f7..07a571ca 100644 --- a/WebHost/__init__.py +++ b/WebHostLib/__init__.py @@ -108,5 +108,5 @@ def host_room(room: UUID): return render_template("host_room.html", room=room) -from WebHost.customserver import run_server_process +from WebHostLib.customserver import run_server_process from . import tracker, upload, landing # to trigger app routing picking up on it diff --git a/WebHost/autolauncher.py b/WebHostLib/autolauncher.py similarity index 100% rename from WebHost/autolauncher.py rename to WebHostLib/autolauncher.py diff --git a/WebHost/customserver.py b/WebHostLib/customserver.py similarity index 96% rename from WebHost/customserver.py rename to WebHostLib/customserver.py index 7dc845b4..3cd7df02 100644 --- a/WebHost/customserver.py +++ b/WebHostLib/customserver.py @@ -20,7 +20,7 @@ from Utils import get_public_ipv4, get_public_ipv6 class CustomClientMessageProcessor(ClientMessageProcessor): ctx: WebHostContext def _cmd_video(self, platform, user): - """Set a link for your name in the WebHost 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 self.ctx.video[self.client.team, self.client.slot] = "Twitch", user self.ctx.save() @@ -45,7 +45,7 @@ class WebHostContext(Context): super(WebHostContext, self).__init__("", 0, "", 1, 40, True, "enabled", "enabled", 0) self.main_loop = asyncio.get_running_loop() self.video = {} - self.tags = ["Berserker", "WebHost"] + self.tags = ["Berserker", "WebHostLib"] def listen_to_db_commands(self): cmdprocessor = DBCommandProcessor(self) @@ -139,4 +139,4 @@ def run_server_process(room_id, ponyconfig: dict): asyncio.run(main()) -from WebHost import LOGS_FOLDER +from WebHostLib import LOGS_FOLDER diff --git a/WebHost/landing.py b/WebHostLib/landing.py similarity index 82% rename from WebHost/landing.py rename to WebHostLib/landing.py index 8a8eca26..3bc3488b 100644 --- a/WebHost/landing.py +++ b/WebHostLib/landing.py @@ -1,5 +1,5 @@ from flask import render_template -from WebHost import app, cache +from WebHostLib import app, cache @cache.memoize(timeout=300) diff --git a/WebHost/models.py b/WebHostLib/models.py similarity index 100% rename from WebHost/models.py rename to WebHostLib/models.py diff --git a/WebHost/requirements.txt b/WebHostLib/requirements.txt similarity index 100% rename from WebHost/requirements.txt rename to WebHostLib/requirements.txt diff --git a/WebHost/static/jquery.scrollsync.js b/WebHostLib/static/jquery.scrollsync.js similarity index 100% rename from WebHost/static/jquery.scrollsync.js rename to WebHostLib/static/jquery.scrollsync.js diff --git a/WebHost/static/static.css b/WebHostLib/static/static.css similarity index 100% rename from WebHost/static/static.css rename to WebHostLib/static/static.css diff --git a/WebHost/templates/host_room.html b/WebHostLib/templates/host_room.html similarity index 100% rename from WebHost/templates/host_room.html rename to WebHostLib/templates/host_room.html diff --git a/WebHost/templates/landing.html b/WebHostLib/templates/landing.html similarity index 100% rename from WebHost/templates/landing.html rename to WebHostLib/templates/landing.html diff --git a/WebHost/templates/layout.html b/WebHostLib/templates/layout.html similarity index 100% rename from WebHost/templates/layout.html rename to WebHostLib/templates/layout.html diff --git a/WebHost/templates/macros.html b/WebHostLib/templates/macros.html similarity index 100% rename from WebHost/templates/macros.html rename to WebHostLib/templates/macros.html diff --git a/WebHost/templates/tracker.html b/WebHostLib/templates/tracker.html similarity index 100% rename from WebHost/templates/tracker.html rename to WebHostLib/templates/tracker.html diff --git a/WebHost/templates/uploads.html b/WebHostLib/templates/uploads.html similarity index 100% rename from WebHost/templates/uploads.html rename to WebHostLib/templates/uploads.html diff --git a/WebHost/templates/view_seed.html b/WebHostLib/templates/view_seed.html similarity index 100% rename from WebHost/templates/view_seed.html rename to WebHostLib/templates/view_seed.html diff --git a/WebHost/tracker.py b/WebHostLib/tracker.py similarity index 99% rename from WebHost/tracker.py rename to WebHostLib/tracker.py index d0d18b66..385b7bef 100644 --- a/WebHost/tracker.py +++ b/WebHostLib/tracker.py @@ -7,7 +7,7 @@ import logging from uuid import UUID import Items -from WebHost import app, cache, Room +from WebHostLib import app, cache, Room def get_id(item_name): diff --git a/WebHost/upload.py b/WebHostLib/upload.py similarity index 98% rename from WebHost/upload.py rename to WebHostLib/upload.py index 890e027e..547665d7 100644 --- a/WebHost/upload.py +++ b/WebHostLib/upload.py @@ -6,7 +6,7 @@ import logging from flask import request, flash, redirect, url_for, session, render_template from pony.orm import commit, select -from WebHost import app, allowed_file, Seed, Room, Patch +from WebHostLib import app, allowed_file, Seed, Room, Patch accepted_zip_contents = {"patches": ".bmbp", "spoiler": ".txt", From 963bb7998caebbab4f9037a14f2b71830e313b8e Mon Sep 17 00:00:00 2001 From: Berserker66 Date: Sat, 11 Jul 2020 17:44:52 +0200 Subject: [PATCH 5/9] WebHost: Correct WebHost tag --- WebHostLib/customserver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebHostLib/customserver.py b/WebHostLib/customserver.py index 3cd7df02..00ba1771 100644 --- a/WebHostLib/customserver.py +++ b/WebHostLib/customserver.py @@ -45,7 +45,7 @@ class WebHostContext(Context): super(WebHostContext, self).__init__("", 0, "", 1, 40, True, "enabled", "enabled", 0) self.main_loop = asyncio.get_running_loop() self.video = {} - self.tags = ["Berserker", "WebHostLib"] + self.tags = ["Berserker", "WebHost"] def listen_to_db_commands(self): cmdprocessor = DBCommandProcessor(self) From 319a315ec58dec745440935b048bb12bacf5c4a2 Mon Sep 17 00:00:00 2001 From: caitsith2 Date: Sat, 11 Jul 2020 13:19:38 -0700 Subject: [PATCH 6/9] Fix !countdown and actually make !options work --- MultiServer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MultiServer.py b/MultiServer.py index ce518614..b969b55a 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -647,7 +647,7 @@ class CommonCommandProcessor(CommandProcessor): for option in self.simple_options: self.output(f"Option {option} is set to {getattr(self.ctx, option)}") -class ClientMessageProcessor(CommandProcessor): +class ClientMessageProcessor(CommonCommandProcessor): marker = "!" def __init__(self, ctx: Context, client: Client): From 8d3cb3e53122234737e71818c9e608e5f06a5f5f Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 12 Jul 2020 03:01:11 +0200 Subject: [PATCH 7/9] mention door rando options on master yaml --- easy.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/easy.yaml b/easy.yaml index 8cc7f5ca..0aa0af95 100644 --- a/easy.yaml +++ b/easy.yaml @@ -185,9 +185,10 @@ timer: glitch_boots: on: 1 # enables that you start with Pegasus Boots in any glitched logic mode off: 0 -remote_items: # Warning: currently broken. Stores all your items on the server, effectively sending them to you as if another player picked it up - on: 0 # intended for racing, as the item information is missing from the ROM - off: 1 +door_shuffle: # Only available if the host uses the doors branch, it is ignored otherwise + vanilla: 1 # everything should be like in vanilla + basic: 0 # dungeons are shuffled within themselves. + crossed: 0 # dungeons are shuffled across each other. linked_options: - name: crosskeys options: # these overwrite earlier options if the percentage chance triggers From 66f7295b68e557f2a204058582eedf6a8aeaab4a Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 12 Jul 2020 05:16:01 +0200 Subject: [PATCH 8/9] remove a lie --- Text.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Text.py b/Text.py index 67d844cc..745c6940 100644 --- a/Text.py +++ b/Text.py @@ -281,7 +281,6 @@ junk_texts = [ "{C:GREEN}\nThe gnome asks\nyou to guess\nhis name. >", "{C:GREEN}\nI heard beans\non toast is a\ngreat meal. >", "{C:GREEN}\n> Sweetcorn\non pizza is a\ngreat choice.", - "{C:GREEN}\n> race roms\ndon’t have\nspoiler logs", "{C:GREEN}\nI bet a nice\ncup of tea\nwould help! >", "{C:GREEN}\nI bet you\nexpected help,\ndidn't you? >", "{C:GREEN}\nLearn to make\nplogues, easy\nand yummy! >", From a97e8c412ebf5b653697418587c67fcd58fd8efe Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 12 Jul 2020 16:41:46 +0200 Subject: [PATCH 9/9] fix a junk hint --- Text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Text.py b/Text.py index 745c6940..b1617c24 100644 --- a/Text.py +++ b/Text.py @@ -296,7 +296,7 @@ junk_texts = [ "{C:GREEN}\n> READ\nor the owl\nwill eat you.", "{C:GREEN}\n> Bunnies\nare cute.", "{C:GREEN}\nPugs are the\nsuperior dog\nbreed. >", - "{C:GREEN}\nYou are\nplaying\nALTTPR. >", + "{C:GREEN}\nThis is\nBerserker's\nMultiworld.>", "{C:GREEN}\nOther randos\nexist too!\nTry some! >", ]