From 82637ff072ebb9a00d0f43bf4cb57ad618379aec Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 30 Jan 2022 20:06:03 -0500 Subject: [PATCH] [WebHost] Add version notice to /generate and /uploads --- WebHostLib/generate.py | 3 ++- WebHostLib/templates/generate.html | 4 ++++ WebHostLib/templates/hostGame.html | 7 +++++-- WebHostLib/upload.py | 3 ++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/WebHostLib/generate.py b/WebHostLib/generate.py index f80f4c51..58bd4441 100644 --- a/WebHostLib/generate.py +++ b/WebHostLib/generate.py @@ -5,6 +5,7 @@ import json import zipfile from collections import Counter from typing import Dict, Optional as TypeOptional +from Utils import __version__ from flask import request, flash, redirect, url_for, session, render_template @@ -78,7 +79,7 @@ def generate(race=False): return redirect(url_for("view_seed", seed=seed_id)) - return render_template("generate.html", race=race) + return render_template("generate.html", race=race, version=__version__) def gen_game(gen_options, meta: TypeOptional[Dict[str, object]] = None, owner=None, sid=None): diff --git a/WebHostLib/templates/generate.html b/WebHostLib/templates/generate.html index 9004bc48..6fefb1e2 100644 --- a/WebHostLib/templates/generate.html +++ b/WebHostLib/templates/generate.html @@ -17,6 +17,10 @@ files. If you do not have a config (.yaml) file yet, you may create one on the game's settings page, which you can find via the supported games list.

+

+ Note: this website will always generate games using the current release version of Archipelago, + currently v{{ version }}. +

{% if race -%} This game will be generated in race mode, diff --git a/WebHostLib/templates/hostGame.html b/WebHostLib/templates/hostGame.html index 0b4c9484..36c0ace1 100644 --- a/WebHostLib/templates/hostGame.html +++ b/WebHostLib/templates/hostGame.html @@ -18,9 +18,12 @@ generated a game on your own computer, you may upload the zip file created by the generator to host the game here. This will also provide a tracker, and the ability for your players to download their patch files. -

- In addition to the zip file created by the generator, you may upload a multidata file here as well.

+

+ Note: this website will only host games generated using the current release version of Archipelago, + currently v{{ version }}. +

+

In addition to the zip file created by the generator, you may upload a multidata file here as well.

diff --git a/WebHostLib/upload.py b/WebHostLib/upload.py index bf3dc77a..d444b080 100644 --- a/WebHostLib/upload.py +++ b/WebHostLib/upload.py @@ -11,6 +11,7 @@ from pony.orm import flush, select from WebHostLib import app, Seed, Room, Slot from Utils import parse_yaml, VersionException from Patch import preferred_endings +from Utils import __version__ banned_zip_contents = (".sfc",) @@ -125,7 +126,7 @@ def uploads(): return redirect(url_for("view_seed", seed=seed.id)) else: flash("Not recognized file format. Awaiting a .archipelago file or .zip containing one.") - return render_template("hostGame.html") + return render_template("hostGame.html", version=__version__) @app.route('/user-content', methods=['GET'])