Spielstand speichern

This commit is contained in:
lena_smd02 2026-07-15 15:13:22 +02:00
parent 6a0f2fab43
commit dacb030b57

View file

@ -24,8 +24,8 @@ def start():
db.close()
return redirect("/app/raum/1")
html = '<h1>Verlies</h1>'
if "spieler" in session:
html = '<h1>Verlies</h1>'
if "spieler" in session:
db = get_db()
s = db.execute(
"SELECT raum_id FROM spielstand WHERE spieler=?",
@ -35,7 +35,7 @@ def start():
if s:
html = html + '<p>Willkommen zurück, ' + session["spieler"] + '!</p>' \
+ '<a href="/app/raum/' + str(s["raum_id"]) + '">Weiterspielen</a><hr>'
return html + '<form method="post">Dein Name: ' \
return html + '<form method="post">Dein Name: ' \
+ '<input name="name"> <button>Abenteuer starten</button></form>'
@app.route("/raum/<int:id>", methods=["GET", "POST"])