Track inactive games and add a command to lock the server for updates

A game that has had no activity for 5 minutes is considered inactive. There can be a limited number of inactive games before they are deleted. A console command is added that will wait for all games to become inactive before stopping the server, and prevent starting new games.
This commit is contained in:
Andrio Celos
2022-12-28 00:03:10 +11:00
parent 7a7d03d165
commit 673eb18aa9
4 changed files with 65 additions and 7 deletions

View File

@@ -47,7 +47,9 @@ preGameForm.addEventListener('submit', e => {
setGameUrl(response.gameID);
getGameInfo(response.gameID, 0);
} else
} else if (request.status == 503)
communicationError('The server is temporarily locked for an update. Please try again soon.', true, () => setLoadingMessage(null));
else
communicationError('Unable to create the room.', true, () => setLoadingMessage(null));
});
request.addEventListener('error', () => {