From 6f49d81664b938d6f50f4e7383e9f876e31f93da Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 5 Aug 2024 04:18:48 +0100 Subject: [PATCH] api: handle player not setting scores for the day --- .../cc/fascinated/platform/impl/ScoreSaberPlatform.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/API/src/main/java/cc/fascinated/platform/impl/ScoreSaberPlatform.java b/API/src/main/java/cc/fascinated/platform/impl/ScoreSaberPlatform.java index 06484da..7a11ba4 100644 --- a/API/src/main/java/cc/fascinated/platform/impl/ScoreSaberPlatform.java +++ b/API/src/main/java/cc/fascinated/platform/impl/ScoreSaberPlatform.java @@ -153,6 +153,12 @@ public class ScoreSaberPlatform extends Platform { history.setRank(account.getRank()); history.setCountryRank(account.getCountryRank()); } + // If the player didn't set any scores today, we need to set these values + if (history.getTotalPlayCount() == null || history.getTotalRankedPlayCount() == null || history.getTotalUnrankedPlayCount() == null) { + history.setTotalPlayCount(this.scoreService.getTotalScores(this.getPlatform(), user)); // Get the total scores for the platform + history.setTotalRankedPlayCount(this.scoreService.getTotalRankedScores(this.getPlatform(), user)); // Get the total ranked scores for the platform + history.setTotalUnrankedPlayCount(this.scoreService.getTotalUnrankedScores(this.getPlatform(), user)); // Get the total unranked scores for the platform + } this.userService.saveUser(user); // Save the user } }