From 75932f22579941cec488aa52f9d90d13a724a72b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Gdula?= Date: Fri, 23 Jun 2023 22:30:33 +0300 Subject: [PATCH] Remove 10s score cockblock as it seems to break things ???????? Make session key show when it was last used --- TFR/server/api.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/TFR/server/api.py b/TFR/server/api.py index 52d7243..e7e9188 100644 --- a/TFR/server/api.py +++ b/TFR/server/api.py @@ -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!"