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 {
|
export interface IServerInfo extends ServerResponse {
|
||||||
/** The version that the server is currently running. */
|
/** The version that the server is currently running. */
|
||||||
version?: string;
|
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 { WebsocketEvent } from "@/types/WebsocketEvent";
|
||||||
import { VERSION } from "../constants";
|
import { VERSION } from "@/constants";
|
||||||
|
import { games, log } from "@/main";
|
||||||
import { Status } from "common";
|
import { Status } from "common";
|
||||||
import { log } from "../main";
|
|
||||||
|
|
||||||
const data: WebsocketEvent = {
|
const data: WebsocketEvent = {
|
||||||
name: "req:server.info",
|
name: "req:server.info",
|
||||||
|
|
@ -13,6 +13,7 @@ const data: WebsocketEvent = {
|
||||||
{
|
{
|
||||||
status: Status.Success,
|
status: Status.Success,
|
||||||
version: VERSION,
|
version: VERSION,
|
||||||
|
game_count: games.count,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue