feat(stats): minigame stats (#1249)

Reviewed-on: OpenWF/SpaceNinjaServer#1249
Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
This commit is contained in:
AMelonInsideLemon 2025-03-21 02:40:04 -07:00 committed by Sainan
parent 4cd35ef4d9
commit 7d3f2e8796
3 changed files with 25 additions and 1 deletions

View File

@ -92,7 +92,12 @@ const statsSchema = new Schema<IStatsDatabase>({
Deaths: Number,
HealCount: Number,
ReviveCount: Number,
Races: { type: Map, of: raceSchema, default: {} }
Races: { type: Map, of: raceSchema, default: {} },
ZephyrScore: Number,
SentinelGameScore: Number,
CaliberChicksScore: Number,
OlliesCrashCourseScore: Number,
DojoObstacleScore: Number
});
statsSchema.set("toJSON", {

View File

@ -305,6 +305,15 @@ export const updateStats = async (playerStats: TStatsDatabaseDocument, payload:
break;
case "ZephyrScore":
case "SentinelGameScore":
case "CaliberChicksScore":
case "OlliesCrashCourseScore":
case "DojoObstacleScore":
playerStats[category] ??= 0;
if (data > playerStats[category]) playerStats[category] = data;
break;
default:
if (!ignoredCategories.includes(category)) {
if (!unknownCategories[action]) {

View File

@ -26,6 +26,11 @@ export interface IStatsClient {
HealCount?: number;
ReviveCount?: number;
Races?: Map<string, IRace>;
ZephyrScore?: number;
SentinelGameScore?: number;
CaliberChicksScore?: number;
OlliesCrashCourseScore?: number;
DojoObstacleScore?: number;
}
export interface IStatsDatabase extends IStatsClient {
@ -139,6 +144,11 @@ export interface IStatsMax {
WEAPON_XP?: IUploadEntry;
MISSION_SCORE?: IUploadEntry;
RACE_SCORE?: IUploadEntry;
ZephyrScore?: number;
SentinelGameScore?: number;
CaliberChicksScore?: number;
OlliesCrashCourseScore?: number;
DojoObstacleScore?: number;
}
export interface IStatsSet {