Remove 10s score cockblock as it seems to break things

????????

Make session key show when it was last used
This commit is contained in:
Michał Gdula 2023-06-23 22:30:33 +03:00
parent 2a1c83a44e
commit 75932f2257

View file

@ -67,22 +67,23 @@ def post():
if int(difficulty) not in GAME_DIFFICULTIES:
return "Invalid difficulty!"
# This is a fix for a bug in the game that we dunno how to actually fix
# Yupeeeeeeeeee
if score < 10:
return "Score is impossible!"
# if score < 10:
# return "Score is impossible!"
session_data = Sessions.query.filter_by(auth_key=session_key).first()
if not session_data:
return "Authentication failed!"
score = Scores(
score_upload = Scores(
score=float(score),
difficulty=int(difficulty),
version=version,
user_id=session_data.user_id,
)
db.session.add(score)
session_data.last_used = db.func.now()
db.session.add(score_upload)
db.session.commit()
return "Success!"