Initial WebUI + Old version compatibility

This commit is contained in:
magmaus3 2023-07-06 18:53:00 +02:00
parent a7b9b5b87f
commit 98cc05198f
Signed by: magmaus3
GPG key ID: 966755D3F4A9B251
3 changed files with 390 additions and 321 deletions

View file

@ -14,7 +14,10 @@ from . import hooks
from . import object_storage
import pymongo
from .webui import webui
app = FastAPI()
app.include_router(webui.app)
hook = hook_system.hook
@ -288,7 +291,7 @@ async def stopMapPlay(
playtime: int = Form(),
totalDeaths: int = Form(),
totalTime: int = Form(),
fullClear: int = Form(),
fullClear: int = Form(default=0), # old version compatibility
replayData: str = Form(),
Authorization: Union[str, None] = Header(default=None),
):
@ -409,9 +412,9 @@ async def upload_map(
hideInChallenges: int = Form(),
tags: str = Form(default=""),
rng: int = Form(),
numSubmaps: int = Form(),
dragonCoins: int = Form(),
replayVisibility: int = Form(),
numSubmaps: int = Form(default=0), # Defaults here are set for
dragonCoins: int = Form(default=0), # compatibility with
replayVisibility: int = Form(default=0), # older game versions
clientVersion: float = Form(),
):
authcheck = db.auth_check(Authorization)