fix: fixed a bug where the the timeoutTime is negative
This commit is contained in:
parent
7d486df64f
commit
96ce2ebde2
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user