## Description:

 needs prereq of https://github.com/openfrontio/infra/pull/272

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

w.o.n
This commit is contained in:
Ryan
2026-03-24 12:53:32 -07:00
committed by GitHub
parent e2d58380a7
commit 6e67c2bf0d
4 changed files with 15 additions and 1 deletions
+9
View File
@@ -87,6 +87,8 @@ export class GameServer {
private lobbyInfoIntervalId: ReturnType<typeof setInterval> | null = null;
private visibleAt?: number;
constructor(
public readonly id: string,
readonly log_: Logger,
@@ -98,6 +100,9 @@ export class GameServer {
private publicGameType?: PublicGameType,
) {
this.log = log_.child({ gameID: id });
if (startsAt !== undefined) {
this.visibleAt = Date.now();
}
}
private get lobbyCreatorID(): ClientID | undefined {
@@ -558,6 +563,8 @@ export class GameServer {
public setStartsAt(startsAt: number) {
this.startsAt = startsAt;
// Record when the lobby first became visible to players, used to measure lobby fill time.
this.visibleAt ??= Date.now();
}
public numClients(): number {
@@ -656,6 +663,7 @@ export class GameServer {
const result = GameStartInfoSchema.safeParse({
gameID: this.id,
lobbyCreatedAt: this.createdAt,
visibleAt: this.visibleAt,
config: this.gameConfig,
players: this.activeClients.map((c) => ({
username: c.username,
@@ -1001,6 +1009,7 @@ export class GameServer {
Date.now(),
this.winner?.winner,
this.createdAt,
this.visibleAt,
),
),
);