Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.

Commit 1c10110

Browse files
committed
firstplace steal from restricted users
1 parent 7795df2 commit 1c10110

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

common/ripple/user_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,8 @@ async def recalculate_and_update_first_place_scores(user_id: int) -> None:
983983
give them back their #1 scores.
984984
985985
This works for vanilla, relax and autopilot.
986+
987+
NOTE: this function ASSUMES that you're calling it with an unbanned user
986988
"""
987989

988990
# The algorithm works as follows:
@@ -1008,10 +1010,12 @@ async def recalculate_and_update_first_place_scores(user_id: int) -> None:
10081010
f"""
10091011
SELECT scores_first.scoreid, scores_first.userid, scores.{order} AS score_value
10101012
FROM scores_first
1011-
JOIN {table_name} AS scores ON scores.id = scores_first.scoreid
1013+
INNER JOIN {table_name} AS scores ON scores.id = scores_first.scoreid
1014+
INNER JOIN users ON users.id = scores_first.userid
10121015
WHERE beatmap_md5 = %s
10131016
AND scores_first.mode = %s
10141017
AND scores_first.rx = %s
1018+
AND users.privileges & 1
10151019
""",
10161020
[score["beatmap_md5"], score["play_mode"], rx],
10171021
)

0 commit comments

Comments
 (0)