[WebHost] Add version notice to /generate and /uploads
This commit is contained in:
parent
a95a18a8b5
commit
82637ff072
|
@ -5,6 +5,7 @@ import json
|
||||||
import zipfile
|
import zipfile
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
from typing import Dict, Optional as TypeOptional
|
from typing import Dict, Optional as TypeOptional
|
||||||
|
from Utils import __version__
|
||||||
|
|
||||||
from flask import request, flash, redirect, url_for, session, render_template
|
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 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):
|
def gen_game(gen_options, meta: TypeOptional[Dict[str, object]] = None, owner=None, sid=None):
|
||||||
|
|
|
@ -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,
|
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 <a href="{{ url_for("games") }}">supported games list</a>.
|
which you can find via the <a href="{{ url_for("games") }}">supported games list</a>.
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
Note: this website will always generate games using the current release version of Archipelago,
|
||||||
|
currently v{{ version }}.
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
{% if race -%}
|
{% if race -%}
|
||||||
This game will be generated in race mode,
|
This game will be generated in race mode,
|
||||||
|
|
|
@ -18,9 +18,12 @@
|
||||||
generated a game on your own computer, you may upload the zip file created by the generator to
|
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
|
host the game here. This will also provide a tracker, and the ability for your players to download
|
||||||
their patch files.
|
their patch files.
|
||||||
<br /><br />
|
|
||||||
In addition to the zip file created by the generator, you may upload a multidata file here as well.
|
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
Note: this website will only host games generated using the current release version of Archipelago,
|
||||||
|
currently v{{ version }}.
|
||||||
|
</p>
|
||||||
|
<p>In addition to the zip file created by the generator, you may upload a multidata file here as well.</p>
|
||||||
<div id="host-game-form-wrapper">
|
<div id="host-game-form-wrapper">
|
||||||
<form id="host-game-form" method="post" enctype="multipart/form-data">
|
<form id="host-game-form" method="post" enctype="multipart/form-data">
|
||||||
<input id="file-input" type="file" name="file">
|
<input id="file-input" type="file" name="file">
|
||||||
|
|
|
@ -11,6 +11,7 @@ from pony.orm import flush, select
|
||||||
from WebHostLib import app, Seed, Room, Slot
|
from WebHostLib import app, Seed, Room, Slot
|
||||||
from Utils import parse_yaml, VersionException
|
from Utils import parse_yaml, VersionException
|
||||||
from Patch import preferred_endings
|
from Patch import preferred_endings
|
||||||
|
from Utils import __version__
|
||||||
|
|
||||||
banned_zip_contents = (".sfc",)
|
banned_zip_contents = (".sfc",)
|
||||||
|
|
||||||
|
@ -125,7 +126,7 @@ def uploads():
|
||||||
return redirect(url_for("view_seed", seed=seed.id))
|
return redirect(url_for("view_seed", seed=seed.id))
|
||||||
else:
|
else:
|
||||||
flash("Not recognized file format. Awaiting a .archipelago file or .zip containing one.")
|
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'])
|
@app.route('/user-content', methods=['GET'])
|
||||||
|
|
Loading…
Reference in New Issue