mirror of
https://github.com/AlecM33/Werewolf.git
synced 2025-12-26 15:57:50 +01:00
display start game button all the time, change kill/reveal buttons
This commit is contained in:
@@ -50,7 +50,7 @@ router.post('/create', function (req, res) {
|
||||
if (result instanceof Error) {
|
||||
res.status(500).send();
|
||||
} else {
|
||||
res.send(result); // game was created successfully, and access code was returned
|
||||
res.status(201).send(result); // game was created successfully, and access code was returned
|
||||
}
|
||||
}).catch((e) => {
|
||||
if (e === globals.ERROR_MESSAGE.BAD_CREATE_REQUEST) {
|
||||
|
||||
@@ -20,7 +20,7 @@ const globals = {
|
||||
res.status(400).send('Request has invalid content type.');
|
||||
}
|
||||
},
|
||||
STALE_GAME_HOURS: 12,
|
||||
STALE_GAME_HOURS: 24,
|
||||
CLIENT_COMMANDS: {
|
||||
FETCH_GAME_STATE: 'fetchGameState',
|
||||
START_GAME: 'startGame',
|
||||
|
||||
@@ -530,7 +530,7 @@ function pruneStaleGames (activeGames, timerThreads, logger) {
|
||||
for (const [accessCode, game] of Object.entries(activeGames)) {
|
||||
if (game.createTime) {
|
||||
const createDate = new Date(game.createTime);
|
||||
if (createDate.setHours(createDate.getHours() + globals.STALE_GAME_HOURS) < Date.now()) { // clear games created more than 12 hours ago
|
||||
if (createDate.setHours(createDate.getHours() + globals.STALE_GAME_HOURS) < Date.now()) {
|
||||
logger.info('PRUNING STALE GAME ' + accessCode);
|
||||
delete activeGames[accessCode];
|
||||
if (timerThreads[accessCode]) {
|
||||
|
||||
Reference in New Issue
Block a user