diff --git a/WebHostLib/__init__.py b/WebHostLib/__init__.py index ab10b516..1f33dddc 100644 --- a/WebHostLib/__init__.py +++ b/WebHostLib/__init__.py @@ -46,6 +46,7 @@ app.config["PONY"] = { app.config["MAX_ROLL"] = 20 app.config["CACHE_TYPE"] = "simple" app.config["JSON_AS_ASCII"] = False +app.config["PATCH_TARGET"] = "archipelago.gg" app.autoversion = True diff --git a/WebHostLib/customserver.py b/WebHostLib/customserver.py index 080f396e..96d233d8 100644 --- a/WebHostLib/customserver.py +++ b/WebHostLib/customserver.py @@ -81,9 +81,9 @@ class WebHostContext(Context): def init_save(self, enabled: bool = True): self.saving = enabled if self.saving: - existing_savegame = restricted_loads(Room.get(id=self.room_id).multisave) - if existing_savegame: - self.set_save(existing_savegame) + savegame_data = Room.get(id=self.room_id).multisave + if savegame_data: + self.set_save(restricted_loads(Room.get(id=self.room_id).multisave)) self._start_async_saving() threading.Thread(target=self.listen_to_db_commands, daemon=True).start() diff --git a/WebHostLib/downloads.py b/WebHostLib/downloads.py index 266d313f..ceb464ac 100644 --- a/WebHostLib/downloads.py +++ b/WebHostLib/downloads.py @@ -16,7 +16,7 @@ def download_patch(room_id, patch_id): room = Room.get(id=room_id) last_port = room.last_port - patch_data = update_patch_data(patch.data, server=f"{app.config['HOSTNAME']}:{last_port}") + patch_data = update_patch_data(patch.data, server=f"{app.config['PATCH_TARGET']}:{last_port}") patch_data = io.BytesIO(patch_data) fname = f"P{patch.player_id}_{patch.player_name}_{app.jinja_env.filters['suuid'](room_id)}.apbp" diff --git a/WebHostLib/templates/macros.html b/WebHostLib/templates/macros.html index a8ac2f27..4e80cb20 100644 --- a/WebHostLib/templates/macros.html +++ b/WebHostLib/templates/macros.html @@ -9,7 +9,7 @@ {% macro list_patches_room(room) %} {% if room.seed.patches %}