From 0ddf5d8a14e2cd93fd4661acb8dc4b3e803b821b Mon Sep 17 00:00:00 2001 From: Oliver Akins Date: Mon, 7 Mar 2022 23:36:41 -0600 Subject: [PATCH] Add a game count to the server info response --- common/src/types/events/server_info.ts | 3 +++ server/src/events/server_info.ts | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/src/types/events/server_info.ts b/common/src/types/events/server_info.ts index 594a966..a7835af 100644 --- a/common/src/types/events/server_info.ts +++ b/common/src/types/events/server_info.ts @@ -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; } \ No newline at end of file diff --git a/server/src/events/server_info.ts b/server/src/events/server_info.ts index 1e1a5d0..dff12dc 100644 --- a/server/src/events/server_info.ts +++ b/server/src/events/server_info.ts @@ -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, } ); },