Update score.py

Fix two bugs.
This commit is contained in:
Lost-MSth
2022-07-04 23:14:23 +08:00
parent 6fcca17918
commit 9d746eab2d

View File

@@ -1,9 +1,9 @@
from time import time from time import time
from .constant import Constant
from .error import NoData, StaminaNotEnough from .error import NoData, StaminaNotEnough
from .song import Chart from .song import Chart
from .util import md5 from .util import md5
from .constant import Constant
from .world import WorldPlay from .world import WorldPlay
@@ -219,13 +219,11 @@ class UserPlay(UserScore):
return False return False
# 歌曲谱面MD5检查服务器没有谱面就不管了 # 歌曲谱面MD5检查服务器没有谱面就不管了
# TODO: 这里肯定是要改的了 from .download import get_song_file_md5
self.c.execute('''select md5 from songfile where song_id=:a and file_type=:b''', { songfile_hash = get_song_file_md5(
'a': self.song.song_id, 'b': self.song.difficulty}) self.song.song_id, str(self.song.difficulty) + '.aff')
x = self.c.fetchone() if songfile_hash and songfile_hash != self.song_hash:
if x: return False
if x[0] != self.song_hash:
return False
x = self.song_token + self.song_hash + self.song.song_id + str(self.song.difficulty) + str(self.score) + str(self.shiny_perfect_count) + str( x = self.song_token + self.song_hash + self.song.song_id + str(self.song.difficulty) + str(self.score) + str(self.shiny_perfect_count) + str(
self.perfect_count) + str(self.near_count) + str(self.miss_count) + str(self.health) + str(self.modifier) + str(self.clear_type) self.perfect_count) + str(self.near_count) + str(self.miss_count) + str(self.health) + str(self.modifier) + str(self.clear_type)
@@ -448,6 +446,6 @@ class Potential:
sql_list.append(self.r30[i]) sql_list.append(self.r30[i])
sql_list.append(self.s30[i]) sql_list.append(self.s30[i])
sql.list.append(self.user.user_id) sql_list.append(self.user.user_id)
self.c.execute(sql, sql_list) self.c.execute(sql, sql_list)