From 40dd23da93d982b33c4a73f8a4e6a18d6ee89def Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Thu, 16 Mar 2023 21:46:26 -0500 Subject: [PATCH] Altered Blitz action timeout from 3 -> 5 minutes. Separated table inactivity and chat inactivity timeouts, which should hopefully permit mobile users to be able to switch applications for up to 5 minutes before needing to log in again. --- gemp-lotr/gemp-lotr-async/src/main/web/hall.html | 2 +- .../java/com/gempukku/lotro/hall/HallServer.java | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/hall.html b/gemp-lotr/gemp-lotr-async/src/main/web/hall.html index 2ecfff1a3..4c9892e26 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/hall.html +++ b/gemp-lotr/gemp-lotr-async/src/main/web/hall.html @@ -218,7 +218,7 @@ diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java index 9a5f1a371..efbbca609 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/hall/HallServer.java @@ -31,13 +31,15 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; public class HallServer extends AbstractServer { private static final GameTimer DEFAULT_TIMER = new GameTimer(false, "Default", 60 * 80, 60 * 5); - private static final GameTimer BLITZ_TIMER = new GameTimer(false, "Blitz!", 60 * 30, 60 * 3); + private static final GameTimer BLITZ_TIMER = new GameTimer(false, "Blitz!", 60 * 30, 60 * 5); private static final GameTimer SLOW_TIMER = new GameTimer(false, "Slow", 60 * 120, 60 * 10); private static final GameTimer GLACIAL_TIMER = new GameTimer(true, "Glacial", 60 * 60 * 24 * 3, 60 * 60 * 24); // 5 minutes timeout, 40 minutes per game per player private static final GameTimer COMPETITIVE_TIMER = new GameTimer(false, "Competitive", 60 * 40, 60 * 5); - private static final int _playerInactivityPeriod = 1000 * 20; // 20 seconds + private static final int _playerTableInactivityPeriod = 1000 * 20 ; // 20 seconds + + private static final int _playerChatInactivityPeriod = 1000 * 60 * 5; // 5 minutes private static final long _scheduledTournamentLoadTime = 1000 * 60 * 60 * 24 * 7; // Week // Repeat tournaments every 2 days private static final long _repeatTournaments = 1000 * 60 * 60 * 24 * 2; @@ -783,14 +785,18 @@ public class HallServer extends AbstractServer { long currentTime = System.currentTimeMillis(); Map visitCopy = new LinkedHashMap<>(_playerChannelCommunication); for (Map.Entry lastVisitedPlayer : visitCopy.entrySet()) { - if (currentTime > lastVisitedPlayer.getValue().getLastAccessed() + _playerInactivityPeriod) { + if (currentTime > lastVisitedPlayer.getValue().getLastAccessed() + _playerTableInactivityPeriod) { Player player = lastVisitedPlayer.getKey(); - _playerChannelCommunication.remove(player); boolean leftTables = leaveAwaitingTablesForLeavingPlayer(player); boolean leftQueues = leaveQueuesForLeavingPlayer(player); if (leftTables || leftQueues) hallChanged(); } + + if (currentTime > lastVisitedPlayer.getValue().getLastAccessed() + _playerChatInactivityPeriod) { + Player player = lastVisitedPlayer.getKey(); + _playerChannelCommunication.remove(player); + } } for (Map.Entry runningTournamentQueue : new HashMap<>(_tournamentQueues).entrySet()) {