Add tests

This commit is contained in:
Andras Schmelczer 2026-06-16 07:54:06 +01:00
parent d0265ad90e
commit b6db7e8dc7
18 changed files with 494 additions and 109 deletions

View file

@ -57,6 +57,12 @@ export class PlayerContainer {
return this._players.length;
}
// Measured round-trip times (ms) of the real connected players, for
// server-side latency stats. NPCs have no socket and are excluded.
public get connectedPlayerRttsMs(): Array<number> {
return this._players.map((p) => p.rttMs);
}
public step(deltaTimeInSeconds: number) {
this.players.forEach((p) => p.step(deltaTimeInSeconds));
}