From 1aa5d3b43edf3fa55570eb8a06ac569ea19aff15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sat, 10 Apr 2021 18:59:27 +0200 Subject: [PATCH] MAPG-226 change remaining time calculation --- multi/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multi/index.js b/multi/index.js index 0dc5558..6e96a5b 100644 --- a/multi/index.js +++ b/multi/index.js @@ -5,7 +5,7 @@ process.title = 'mapguesser-multi'; class MultiGame { static ROUND_TIMEOUT_DEFAULT = 120000; static ROUND_TIMEOUT_MINIMUM = 15000; - static ROUND_TIMEOUT_DIVIDER = 2; + static ROUND_TIMEOUT_DIVIDER = 1.5; static ROUND_TIMEOUT_OFFSET = 500; constructor() { @@ -155,7 +155,7 @@ class MultiGame { } else { round.timeout = round.timeout - (new Date() - round.timeoutStarted); if (round.timeout > MultiGame.ROUND_TIMEOUT_DIVIDER * MultiGame.ROUND_TIMEOUT_MINIMUM) { - round.timeout = round.timeout / MultiGame.ROUND_TIMEOUT_DIVIDER; + round.timeout = Math.round(round.timeout / MultiGame.ROUND_TIMEOUT_DIVIDER); } else if (round.timeout > MultiGame.ROUND_TIMEOUT_MINIMUM) { round.timeout = MultiGame.ROUND_TIMEOUT_MINIMUM; }