Add a game count to the server info response
This commit is contained in:
parent
f9f14422d8
commit
0ddf5d8a14
2 changed files with 7 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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,
|
||||
}
|
||||
);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue