From 96ce2ebde26e280f99df5cac5e6850a13fc7d3e1 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Tue, 8 Jun 2021 01:39:17 +0200 Subject: [PATCH] fix: fixed a bug where the the timeoutTime is negative --- .../uulm/teamname/marvelous/server/lobby/TimeoutTimer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/lobby/TimeoutTimer.java b/Server/src/main/java/uulm/teamname/marvelous/server/lobby/TimeoutTimer.java index af6df57..fe13903 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/lobby/TimeoutTimer.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/lobby/TimeoutTimer.java @@ -50,7 +50,7 @@ public class TimeoutTimer { if (player1AlmostTimeout != null) player1AlmostTimeout.cancel(false); player1AlmostTimeout = timer.schedule(() -> { - almostTimeoutCallback.accept(participant, almostTimeoutTime - timeoutTime); + almostTimeoutCallback.accept(participant, timeoutTime - almostTimeoutTime); return participant; }, this.almostTimeoutTime, TimeUnit.SECONDS); @@ -66,7 +66,7 @@ public class TimeoutTimer { if (player2AlmostTimeout != null) player2AlmostTimeout.cancel(false); player2AlmostTimeout = timer.schedule(() -> { - almostTimeoutCallback.accept(participant, almostTimeoutTime - timeoutTime); + almostTimeoutCallback.accept(participant, timeoutTime - almostTimeoutTime); return participant; }, this.almostTimeoutTime, TimeUnit.SECONDS);