[Enhance] World rank score mechanism

- Adjust world rank mechanism to be closer to the official one.

Note: You need to refresh rating in web admin backend after updating, and the users need to get a better or new score to refresh world rank.
This commit is contained in:
Lost-MSth
2024-06-14 16:06:26 +08:00
parent 338f6579aa
commit 2a08c9cd14
11 changed files with 137 additions and 30 deletions

View File

@@ -351,7 +351,8 @@ class Sql:
class DatabaseMigrator:
SPECIAL_UPDATE_VERSION = {
'2.11.3.11': '_version_2_11_3_11'
'2.11.3.11': '_version_2_11_3_11',
'2.11.3.13': '_version_2_11_3.13'
}
def __init__(self, c1_path: str, c2_path: str) -> None:
@@ -463,6 +464,12 @@ class DatabaseMigrator:
self.c2.executemany(
'''insert into recent30(user_id, r_index, time_played, song_id, difficulty, rating) values(?,?,?,?,?,?)''', sql_list)
def _version_2_11_3_13(self):
'''
2.11.3.13 版本特殊更新world_rank_score 机制调整,需清空用户分数
'''
self.c1.execute('''update user set world_rank_score = 0''')
class LogDatabaseMigrator: