mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 23:41:59 +00:00
02e35c3fca
## Description: Have at least 2 clients and majority vote to decide a winner ## 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 --------- Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
26 lines
788 B
TypeScript
26 lines
788 B
TypeScript
import WebSocket from "ws";
|
|
import { TokenPayload } from "../core/ApiSchemas";
|
|
import { Tick } from "../core/game/Game";
|
|
import { ClientID, Winner } from "../core/Schemas";
|
|
|
|
export class Client {
|
|
public lastPing: number = Date.now();
|
|
|
|
public hashes: Map<Tick, number> = new Map();
|
|
|
|
public reportedWinner: Winner | null = null;
|
|
|
|
constructor(
|
|
public readonly clientID: ClientID,
|
|
public readonly persistentID: string,
|
|
public readonly claims: TokenPayload | null,
|
|
public readonly roles: string[] | undefined,
|
|
public readonly flares: string[] | undefined,
|
|
public readonly ip: string,
|
|
public readonly username: string,
|
|
public readonly ws: WebSocket,
|
|
public readonly flag: string | undefined,
|
|
public readonly pattern: string | undefined,
|
|
) {}
|
|
}
|