mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-21 23:17:40 +00:00
websocket reconnect on failure
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
import {ClientID} from "../core/Game";
|
||||
import {Client} from "./Client";
|
||||
|
||||
export class Lobby {
|
||||
|
||||
public clients: Map<ClientID, Client> = new Map()
|
||||
private startGameTs: number
|
||||
|
||||
|
||||
constructor(public readonly id: string, durationMs: number) {
|
||||
this.startGameTs = Date.now() + durationMs
|
||||
}
|
||||
|
||||
public addClient(client: Client) {
|
||||
this.clients.set(client.id, client)
|
||||
}
|
||||
|
||||
public isExpired(now: number): boolean {
|
||||
return now > this.startGameTs
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user