Fixed old new EventFlow().listen() missing false as third param

This commit is contained in:
2025-11-30 18:03:16 +01:00
parent 3953762178
commit c332033a06
5 changed files with 14 additions and 11 deletions

View File

@@ -96,9 +96,12 @@ public final class Server {
startPopulateScheduler(); startPopulateScheduler();
populateGameList(); populateGameList();
}, false, "startclient").listen(NetworkEvents.ConnectTry.class, e -> {
// Platform.runLater(() -> loading.setAmount(e.amount()));
}).postEvent(); }).postEvent();
new EventFlow().listen(NetworkEvents.ChallengeResponse.class, this::handleReceivedChallenge, false)
.listen(NetworkEvents.GameMatchResponse.class, this::handleMatchResponse, false);
startPopulateScheduler();
populateGameList();
} }
private void sendChallenge(String opponent) { private void sendChallenge(String opponent) {

View File

@@ -71,8 +71,8 @@ public abstract class BaseGameThread<TGame extends Game, TAI, TCanvas> {
new Thread(this::localGameThread).start(); new Thread(this::localGameThread).start();
else else
new EventFlow() new EventFlow()
.listen(NetworkEvents.GameMoveResponse.class, this::onMoveResponse) .listen(NetworkEvents.GameMoveResponse.class, this::onMoveResponse, false)
.listen(NetworkEvents.YourTurnResponse.class, this::onYourTurnResponse); .listen(NetworkEvents.YourTurnResponse.class, this::onYourTurnResponse, false);
setGameLabels(myTurn == 0); setGameLabels(myTurn == 0);
} }

View File

@@ -90,8 +90,8 @@ public class Connect4Game {
setGameLabels(information.players[0].isHuman); setGameLabels(information.players[0].isHuman);
} else { } else {
new EventFlow() new EventFlow()
.listen(NetworkEvents.GameMoveResponse.class, this::onMoveResponse) .listen(NetworkEvents.GameMoveResponse.class, this::onMoveResponse, false)
.listen(NetworkEvents.YourTurnResponse.class, this::onYourTurnResponse); .listen(NetworkEvents.YourTurnResponse.class, this::onYourTurnResponse, false);
setGameLabels(myTurn == 0); setGameLabels(myTurn == 0);
} }

View File

@@ -95,8 +95,8 @@ public final class ReversiGame {
setGameLabels(information.players[0].isHuman); setGameLabels(information.players[0].isHuman);
} else { } else {
new EventFlow() new EventFlow()
.listen(NetworkEvents.GameMoveResponse.class, this::onMoveResponse) .listen(NetworkEvents.GameMoveResponse.class, this::onMoveResponse, false)
.listen(NetworkEvents.YourTurnResponse.class, this::onYourTurnResponse); .listen(NetworkEvents.YourTurnResponse.class, this::onYourTurnResponse, false);
setGameLabels(myTurn == 0); setGameLabels(myTurn == 0);
} }

View File

@@ -88,8 +88,8 @@ public final class TicTacToeGame {
new Thread(this::localGameThread).start(); new Thread(this::localGameThread).start();
} else { } else {
new EventFlow() new EventFlow()
.listen(NetworkEvents.GameMoveResponse.class, this::onMoveResponse) .listen(NetworkEvents.GameMoveResponse.class, this::onMoveResponse, false)
.listen(NetworkEvents.YourTurnResponse.class, this::onYourTurnResponse); .listen(NetworkEvents.YourTurnResponse.class, this::onYourTurnResponse, false);
setGameLabels(myTurn == 0); setGameLabels(myTurn == 0);
} }