From c39ffa91f90112e9dcd764a7b4d0174d2a0fbc20 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 21 May 2025 01:53:42 -0400 Subject: [PATCH] Transition flag from null to undefined (#831) ## Description: Replace `null` with `undefined` for player flags. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors --------- Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com> --- src/core/Schemas.ts | 2 +- src/server/Client.ts | 2 +- src/server/GameServer.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/Schemas.ts b/src/core/Schemas.ts index 1a334b6d0..7e2fff5e2 100644 --- a/src/core/Schemas.ts +++ b/src/core/Schemas.ts @@ -430,7 +430,7 @@ export const ClientJoinMessageSchema = z.object({ gameID: ID, lastTurn: z.number(), // The last turn the client saw. username: SafeString, - flag: SafeString.nullable(), + flag: SafeString.optional(), }); export const ClientMessageSchema = z.union([ diff --git a/src/server/Client.ts b/src/server/Client.ts index a3587c3cd..d5fc46e04 100644 --- a/src/server/Client.ts +++ b/src/server/Client.ts @@ -18,6 +18,6 @@ export class Client { public readonly ip: string, public readonly username: string, public readonly ws: WebSocket, - public readonly flag: string | null, + public readonly flag: string | undefined, ) {} } diff --git a/src/server/GameServer.ts b/src/server/GameServer.ts index 4697c73e3..ec9059468 100644 --- a/src/server/GameServer.ts +++ b/src/server/GameServer.ts @@ -296,7 +296,7 @@ export class GameServer { clientID: c.clientID, flag: c.flag, })), - }); + } satisfies GameStartInfo); this.endTurnIntervalID = setInterval( () => this.endTurn(),