From f4396a1c4279788a4225380dba7f8603dfdcd032 Mon Sep 17 00:00:00 2001 From: Oliver Akins Date: Tue, 8 Mar 2022 13:24:49 -0600 Subject: [PATCH] Add a cleanup method stub on the game manager --- server/src/objects/GameDB.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/src/objects/GameDB.ts b/server/src/objects/GameDB.ts index 7046317..af1abdc 100644 --- a/server/src/objects/GameDB.ts +++ b/server/src/objects/GameDB.ts @@ -22,6 +22,15 @@ export class GameDB { this.games[game.id] = game; }; + /** + * This removes all inactive games from the system, this includes any games + * that do not have any currently connected players and are in the lobby + * state. This will not remove any games that are currently in-progress so + * that players can resume the game later if they happened to all get + * disconnected for some reason. + */ + public cleanup(): void {}; + /** Returns a count of how many games currently exist in the database */ public get count() { return Object.keys(this.games).length;