From 9d24ab53ad8c22db9797c827b237d19aa762d840 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Fri, 12 Sep 2025 08:30:31 -0700 Subject: [PATCH] bugfix: use replacer when stringifying gamerecord for bigints --- src/client/ClientGameRunner.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client/ClientGameRunner.ts b/src/client/ClientGameRunner.ts index e4eb7e162..7645bdaad 100644 --- a/src/client/ClientGameRunner.ts +++ b/src/client/ClientGameRunner.ts @@ -8,7 +8,7 @@ import { PlayerRecord, ServerMessage, } from "../core/Schemas"; -import { createPartialGameRecord } from "../core/Util"; +import { createPartialGameRecord, replacer } from "../core/Util"; import { ServerConfig } from "../core/configuration/Config"; import { getConfig } from "../core/configuration/ConfigLoader"; import { PlayerActions, UnitType } from "../core/game/Game"; @@ -82,14 +82,18 @@ export function joinLobby( const onmessage = (message: ServerMessage) => { if (message.type === "prestart") { - console.log(`lobby: game prestarting: ${JSON.stringify(message)}`); + console.log( + `lobby: game prestarting: ${JSON.stringify(message, replacer)}`, + ); terrainLoad = loadTerrainMap(message.gameMap, terrainMapFileLoader); onPrestart(); } if (message.type === "start") { // Trigger prestart for singleplayer games onPrestart(); - console.log(`lobby: game started: ${JSON.stringify(message, null, 2)}`); + console.log( + `lobby: game started: ${JSON.stringify(message, replacer, 2)}`, + ); onJoin(); // For multiplayer games, GameStartInfo is not known until game starts. lobbyConfig.gameStartInfo = message.gameStartInfo;