Add a game count to the server info response

This commit is contained in:
Oliver Akins 2022-03-07 23:36:41 -06:00
parent f9f14422d8
commit 0ddf5d8a14
No known key found for this signature in database
GPG key ID: 3C2014AF9457AF99
2 changed files with 7 additions and 3 deletions

View file

@ -4,4 +4,7 @@ import { ServerResponse } from "../ServerResponse";
export interface IServerInfo extends ServerResponse {
/** The version that the server is currently running. */
version?: string;
/** The count of how many games are currently stored as active in the Database */
game_count?: number;
}

View file

@ -1,7 +1,7 @@
import { WebsocketEvent } from "../types/WebsocketEvent";
import { VERSION } from "../constants";
import { WebsocketEvent } from "@/types/WebsocketEvent";
import { VERSION } from "@/constants";
import { games, log } from "@/main";
import { Status } from "common";
import { log } from "../main";
const data: WebsocketEvent = {
name: "req:server.info",
@ -13,6 +13,7 @@ const data: WebsocketEvent = {
{
status: Status.Success,
version: VERSION,
game_count: games.count,
}
);
},