Files
OpenFrontIO/src/server/Client.ts
T
Scott Anderson c39ffa91f9 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>
2025-05-21 01:53:42 -04:00

24 lines
678 B
TypeScript

import WebSocket from "ws";
import { TokenPayload } from "../core/ApiSchemas";
import { PlayerID, Tick } from "../core/game/Game";
import { ClientID } from "../core/Schemas";
import { generateID } from "../core/Util";
export class Client {
public lastPing: number;
public hashes: Map<Tick, number> = new Map();
public readonly playerID: PlayerID = generateID();
constructor(
public readonly clientID: ClientID,
public readonly persistentID: string,
public readonly claims: TokenPayload | null,
public readonly ip: string,
public readonly username: string,
public readonly ws: WebSocket,
public readonly flag: string | undefined,
) {}
}