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);
|
if (player1AlmostTimeout != null) player1AlmostTimeout.cancel(false);
|
||||||
player1AlmostTimeout =
|
player1AlmostTimeout =
|
||||||
timer.schedule(() -> {
|
timer.schedule(() -> {
|
||||||
almostTimeoutCallback.accept(participant, almostTimeoutTime - timeoutTime);
|
almostTimeoutCallback.accept(participant, timeoutTime - almostTimeoutTime);
|
||||||
return participant;
|
return participant;
|
||||||
}, this.almostTimeoutTime, TimeUnit.SECONDS);
|
}, this.almostTimeoutTime, TimeUnit.SECONDS);
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ public class TimeoutTimer {
|
|||||||
if (player2AlmostTimeout != null) player2AlmostTimeout.cancel(false);
|
if (player2AlmostTimeout != null) player2AlmostTimeout.cancel(false);
|
||||||
player2AlmostTimeout =
|
player2AlmostTimeout =
|
||||||
timer.schedule(() -> {
|
timer.schedule(() -> {
|
||||||
almostTimeoutCallback.accept(participant, almostTimeoutTime - timeoutTime);
|
almostTimeoutCallback.accept(participant, timeoutTime - almostTimeoutTime);
|
||||||
return participant;
|
return participant;
|
||||||
}, this.almostTimeoutTime, TimeUnit.SECONDS);
|
}, this.almostTimeoutTime, TimeUnit.SECONDS);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user