From 3fe8d28abe75040932648566a73623366162ae0c Mon Sep 17 00:00:00 2001 From: evanpelle Date: Wed, 25 Dec 2024 15:19:35 -0800 Subject: [PATCH] implement pause feature, bugfix: server stops in the beginning if no ticks found --- src/client/GameRunner.ts | 3 +++ src/client/graphics/layers/PlayerInfoOverlay.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/GameRunner.ts b/src/client/GameRunner.ts index e035c0bc3..40cfaf0ab 100644 --- a/src/client/GameRunner.ts +++ b/src/client/GameRunner.ts @@ -188,6 +188,9 @@ export class GameRunner { } catch (error) { showErrorModal(error, this.clientID) this.stop() + const errorText = `Error: ${error.message}\nStack: ${error.stack}`; + consolex.error(errorText) + alert(`Game crashed! client id: ${this.clientID}\n Please paste the following in your bug report in Discord:\n` + errorText); } this.renderer.tick() this.currTurn++ diff --git a/src/client/graphics/layers/PlayerInfoOverlay.ts b/src/client/graphics/layers/PlayerInfoOverlay.ts index 4a709fc24..e754e2b4f 100644 --- a/src/client/graphics/layers/PlayerInfoOverlay.ts +++ b/src/client/graphics/layers/PlayerInfoOverlay.ts @@ -1,7 +1,7 @@ import { LitElement, html, css } from 'lit'; import { customElement, property, state } from 'lit/decorators.js'; import { Layer } from './Layer'; -import { Game, GameType, Player, PlayerType, Relation, Unit, UnitType } from '../../../core/game/Game'; +import { Game, GameType, GameType, Player, PlayerType, Relation, Unit, UnitType } from '../../../core/game/Game'; import { ClientID } from '../../../core/Schemas'; import { EventBus } from '../../../core/EventBus'; import { TransformHandler } from '../TransformHandler';