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