From 61cfe7102cf956d487ed7bc324136018aac0155b Mon Sep 17 00:00:00 2001 From: evanpelle Date: Sun, 9 Mar 2025 19:16:57 -0700 Subject: [PATCH] update error modal to show game id (#197) --- src/client/ClientGameRunner.ts | 19 +++++++++++++++---- src/server/gatekeeper | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/client/ClientGameRunner.ts b/src/client/ClientGameRunner.ts index 0cb616f92..9cdada9ce 100644 --- a/src/client/ClientGameRunner.ts +++ b/src/client/ClientGameRunner.ts @@ -187,7 +187,12 @@ export class ClientGameRunner { this.input.initialize(); this.worker.start((gu: GameUpdateViewData | ErrorUpdate) => { if ("errMsg" in gu) { - showErrorModal(gu.errMsg, gu.stack, this.lobby.clientID); + showErrorModal( + gu.errMsg, + gu.stack, + this.lobby.gameID, + this.lobby.clientID, + ); this.stop(); return; } @@ -234,8 +239,9 @@ export class ClientGameRunner { } if (message.type == "desync") { showErrorModal( - `game: ${this.lobby.gameID}, clientID: ${this.lobby.clientID}, desync from server: ${JSON.stringify(message)}`, + `desync from server: ${JSON.stringify(message)}`, "", + this.lobby.gameID, this.lobby.clientID, ); this.stop(); @@ -309,12 +315,17 @@ export class ClientGameRunner { } } -function showErrorModal(errMsg: string, stack: string, clientID: ClientID) { +function showErrorModal( + errMsg: string, + stack: string, + gameID: GameID, + clientID: ClientID, +) { const errorText = `Error: ${errMsg}\nStack: ${stack}`; consolex.error(errorText); const modal = document.createElement("div"); - const content = `Game crashed! client id: ${clientID}\nPlease paste the following in your bug report in Discord:\n${errorText}`; + const content = `Game crashed! game id: ${gameID}, client id: ${clientID}\nPlease paste the following in your bug report in Discord:\n${errorText}`; // Create elements const pre = document.createElement("pre"); diff --git a/src/server/gatekeeper b/src/server/gatekeeper index 6afe22e56..958deadce 160000 --- a/src/server/gatekeeper +++ b/src/server/gatekeeper @@ -1 +1 @@ -Subproject commit 6afe22e564293acdb1bd4fe58d4d87ef57822fd6 +Subproject commit 958deadcebe0d06dbfcc2378e6ec74bb83821414