feat: remove LocalPersistantStats so we locally save GameRecords

GameRecords also now include PlayerStats
This commit is contained in:
ilan schemoul
2025-03-08 17:39:41 +01:00
parent 2b8cc2cf28
commit 1b76c46bc5
15 changed files with 157 additions and 123 deletions
+3 -2
View File
@@ -24,7 +24,7 @@ import { PlayerImpl } from "./PlayerImpl";
import { TerraNulliusImpl } from "./TerraNulliusImpl";
import { AllianceRequestImpl } from "./AllianceRequestImpl";
import { AllianceImpl } from "./AllianceImpl";
import { ClientID, GameConfig } from "../Schemas";
import { ClientID, AllPlayersStats } from "../Schemas";
import { MessageType } from "./Game";
import { UnitImpl } from "./UnitImpl";
import { consolex } from "../Consolex";
@@ -516,10 +516,11 @@ export class GameImpl implements Game {
});
}
setWinner(winner: Player): void {
setWinner(winner: Player, allPlayersStats: AllPlayersStats): void {
this.addUpdate({
type: GameUpdateType.Win,
winnerID: winner.smallID(),
allPlayersStats,
});
}