From 02d99c0fb1db2bd30ce434f7d989b257912f9b83 Mon Sep 17 00:00:00 2001 From: magmaus3 Date: Sun, 20 Nov 2022 16:13:38 +0100 Subject: [PATCH] Remove user's time, if the previous one is longer than the current one. --- customiwmserver/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/customiwmserver/main.py b/customiwmserver/main.py index 53f1bc6..0614f02 100644 --- a/customiwmserver/main.py +++ b/customiwmserver/main.py @@ -195,7 +195,12 @@ async def stopMapPlay( print(BestUserTime, BestTime) if BestUserTime is None or playtime < BestUserTime: print(BestUserTime) - + + updateQuery = db.maps_collection.update_one( + {"ID": mapID}, + {"$pull": {"Leaderboard": {"UserID": userData.ID}} + } + ) updateQuery = db.maps_collection.update_one( {"ID": mapID}, {