From 90f3d9e1389e76c2d2078bf14a1eb0f351558b5f Mon Sep 17 00:00:00 2001 From: RinChanNOWWW Date: Wed, 16 Feb 2022 10:47:02 +0800 Subject: [PATCH] sdvx: new skill analyzer results should not overwrite better old ones. --- bemani/backend/sdvx/gravitywars.py | 5 +++++ bemani/backend/sdvx/heavenlyhaven.py | 5 +++++ bemani/backend/sdvx/infiniteinfection.py | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/bemani/backend/sdvx/gravitywars.py b/bemani/backend/sdvx/gravitywars.py index 99476ea..6dcb20e 100644 --- a/bemani/backend/sdvx/gravitywars.py +++ b/bemani/backend/sdvx/gravitywars.py @@ -501,6 +501,11 @@ class SoundVoltexGravityWars( achievement_rate = request.child_value('ar') season_id = request.child_value('ssnid') + # Do not update the course achievement when old achievement rate is greater. + old = self.data.local.user.get_achievement(self.game, self.version, userid, (season_id * 100) + course_id, 'course') + if old is not None and old.get_int('achievement_rate') > achievement_rate: + return Node.void('game_3') + self.data.local.user.put_achievement( self.game, self.version, diff --git a/bemani/backend/sdvx/heavenlyhaven.py b/bemani/backend/sdvx/heavenlyhaven.py index 3ab3e9a..ba5db04 100644 --- a/bemani/backend/sdvx/heavenlyhaven.py +++ b/bemani/backend/sdvx/heavenlyhaven.py @@ -3818,6 +3818,11 @@ class SoundVoltexHeavenlyHaven( grade = request.child_value('gr') score = request.child_value('sc') + # Do not update the course achievement when old score is greater. + old = self.data.local.user.get_achievement(self.game, self.version, userid, (season_id * 100) + course_id, 'course') + if old is not None and old.get_int('score') > score: + return Node.void('game') + self.data.local.user.put_achievement( self.game, self.version, diff --git a/bemani/backend/sdvx/infiniteinfection.py b/bemani/backend/sdvx/infiniteinfection.py index 953c125..ece96b0 100644 --- a/bemani/backend/sdvx/infiniteinfection.py +++ b/bemani/backend/sdvx/infiniteinfection.py @@ -2195,6 +2195,11 @@ class SoundVoltexInfiniteInfection( achievement_rate = request.child_value('ar') season_id = request.child_value('ssnid') + # Do not update the course achievement when old achievement rate is greater. + old = self.data.local.user.get_achievement(self.game, self.version, userid, (season_id * 100) + course_id, 'course') + if old is not None and old.get_int('achievement_rate') > achievement_rate: + return Node.void('game_2') + self.data.local.user.put_achievement( self.game, self.version,