track total scores and total ranked scores
This commit is contained in:
parent
cd2f8c0925
commit
bded9969fe
@ -140,13 +140,21 @@ export class PlayerService {
|
||||
if (history == undefined) {
|
||||
history = {}; // Initialize if history is not found
|
||||
}
|
||||
|
||||
const scoreStats = player.scoreStats;
|
||||
|
||||
// Set the history data
|
||||
history.pp = player.pp;
|
||||
history.countryRank = player.countryRank;
|
||||
history.rank = player.rank;
|
||||
history.accuracy = {
|
||||
averageRankedAccuracy: player.scoreStats.averageRankedAccuracy,
|
||||
averageRankedAccuracy: scoreStats.averageRankedAccuracy,
|
||||
};
|
||||
history.scores = {
|
||||
totalScores: scoreStats.totalPlayCount,
|
||||
totalRankedScores: scoreStats.rankedPlayCount,
|
||||
};
|
||||
|
||||
foundPlayer.setStatisticHistory(dateToday, history);
|
||||
foundPlayer.sortStatisticHistory();
|
||||
foundPlayer.lastTracked = new Date();
|
||||
|
@ -114,6 +114,8 @@ export async function getScoreSaberPlayerFromToken(
|
||||
scores: {
|
||||
rankedScores: 0,
|
||||
unrankedScores: 0,
|
||||
totalScores: 0,
|
||||
totalRankedScores: 0,
|
||||
},
|
||||
},
|
||||
...history[todayDate],
|
||||
@ -152,6 +154,10 @@ export async function getScoreSaberPlayerFromToken(
|
||||
statisticHistory[dateKey] = {
|
||||
...statisticHistory[dateKey],
|
||||
rank: rank,
|
||||
scores: {
|
||||
totalScores: token.scoreStats.totalPlayCount,
|
||||
totalRankedScores: token.scoreStats.rankedPlayCount,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,16 @@ export interface PlayerHistory {
|
||||
* The amount of unranked scores set.
|
||||
*/
|
||||
unrankedScores?: number;
|
||||
|
||||
/**
|
||||
* The total amount of ranked scores
|
||||
*/
|
||||
totalRankedScores?: number;
|
||||
|
||||
/**
|
||||
* The total amount of scores
|
||||
*/
|
||||
totalScores?: number;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user