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

@@ -94,11 +94,14 @@ public final class Server {
primary = new ServerView(user, this::sendChallenge, this::disconnect);
WidgetContainer.getCurrentView().transitionNext(primary);
startPopulateScheduler();
populateGameList();
}).postEvent();
new EventFlow().listen(NetworkEvents.ChallengeResponse.class, this::handleReceivedChallenge, false)
.listen(NetworkEvents.GameMatchResponse.class, this::handleMatchResponse, false);
startPopulateScheduler();
populateGameList();
}, false, "startclient").listen(NetworkEvents.ConnectTry.class, e -> {
// Platform.runLater(() -> loading.setAmount(e.amount()));
}).postEvent();
}
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();
else
new EventFlow()
.listen(NetworkEvents.GameMoveResponse.class, this::onMoveResponse)
.listen(NetworkEvents.YourTurnResponse.class, this::onYourTurnResponse);
.listen(NetworkEvents.GameMoveResponse.class, this::onMoveResponse, false)
.listen(NetworkEvents.YourTurnResponse.class, this::onYourTurnResponse, false);
setGameLabels(myTurn == 0);
}

View File

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

View File

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

View File

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