Skip to content

Ratings beta ​

Interface of @v12-engine/engine/server

ts
export interface Ratings

Where a server keeps ratings (GameServerOptions.ratings): what it reads to show in the lobby and the list, and what it tells of every game that ended. createRatings keeps them in a file, or in memory; a game's own keeps them where it likes (a database)

Members ​

get ​

ts
get(mode: string, player: string): Rating | undefined;

A player's standing in a mode, by their rated id (ratedId): none for one who never played it

placeOf ​

ts
placeOf?(mode: string, player: string): RatedPlayer | undefined;

A player's place in a mode (from 1), with their standing: none for one who never played it

record ​

ts
record(result: GameResult): void | Promise<void>;

Takes in a game that ended: the rated seats' ratings move by how it went, against what was expected

top ​

ts
top?(mode: string, count: number): RatedPlayer[];

The best of a mode, best first, with their rated ids and places (from 1): what /ratings lists. A store with none lists nothing