mirror of
https://github.com/2OOP/pism.git
synced 2026-02-05 03:14:50 +00:00
Made all network events async again
This commit is contained in:
@@ -42,7 +42,7 @@ public class NetworkingGameClientHandler extends ChannelInboundHandlerAdapter {
|
|||||||
msg);
|
msg);
|
||||||
new EventFlow()
|
new EventFlow()
|
||||||
.addPostEvent(new NetworkEvents.ServerResponse(this.connectionId))
|
.addPostEvent(new NetworkEvents.ServerResponse(this.connectionId))
|
||||||
.postEvent();
|
.asyncPostEvent();
|
||||||
parseServerReturn(rec);
|
parseServerReturn(rec);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ public class NetworkingGameClientHandler extends ChannelInboundHandlerAdapter {
|
|||||||
.addPostEvent(
|
.addPostEvent(
|
||||||
new NetworkEvents.GameMoveResponse(
|
new NetworkEvents.GameMoveResponse(
|
||||||
this.connectionId, msg[0], msg[1], msg[2]))
|
this.connectionId, msg[0], msg[1], msg[2]))
|
||||||
.postEvent();
|
.asyncPostEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void gameWinConditionHandler(String rec) {
|
private void gameWinConditionHandler(String rec) {
|
||||||
@@ -130,7 +130,7 @@ public class NetworkingGameClientHandler extends ChannelInboundHandlerAdapter {
|
|||||||
|
|
||||||
new EventFlow()
|
new EventFlow()
|
||||||
.addPostEvent(new NetworkEvents.GameResultResponse(this.connectionId, condition))
|
.addPostEvent(new NetworkEvents.GameResultResponse(this.connectionId, condition))
|
||||||
.postEvent();
|
.asyncPostEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void gameChallengeHandler(String rec) {
|
private void gameChallengeHandler(String rec) {
|
||||||
@@ -149,13 +149,13 @@ public class NetworkingGameClientHandler extends ChannelInboundHandlerAdapter {
|
|||||||
.addPostEvent(
|
.addPostEvent(
|
||||||
new NetworkEvents.ChallengeCancelledResponse(
|
new NetworkEvents.ChallengeCancelledResponse(
|
||||||
this.connectionId, msg[0]))
|
this.connectionId, msg[0]))
|
||||||
.postEvent();
|
.asyncPostEvent();
|
||||||
else
|
else
|
||||||
new EventFlow()
|
new EventFlow()
|
||||||
.addPostEvent(
|
.addPostEvent(
|
||||||
new NetworkEvents.ChallengeResponse(
|
new NetworkEvents.ChallengeResponse(
|
||||||
this.connectionId, msg[0], msg[1], msg[2]))
|
this.connectionId, msg[0], msg[1], msg[2]))
|
||||||
.postEvent();
|
.asyncPostEvent();
|
||||||
} catch (ArrayIndexOutOfBoundsException e) {
|
} catch (ArrayIndexOutOfBoundsException e) {
|
||||||
logger.error("Array out of bounds for: {}", rec, e);
|
logger.error("Array out of bounds for: {}", rec, e);
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ public class NetworkingGameClientHandler extends ChannelInboundHandlerAdapter {
|
|||||||
.addPostEvent(
|
.addPostEvent(
|
||||||
new NetworkEvents.GameMatchResponse(
|
new NetworkEvents.GameMatchResponse(
|
||||||
this.connectionId, msg[0], msg[1], msg[2]))
|
this.connectionId, msg[0], msg[1], msg[2]))
|
||||||
.postEvent();
|
.asyncPostEvent();
|
||||||
} catch (ArrayIndexOutOfBoundsException e) {
|
} catch (ArrayIndexOutOfBoundsException e) {
|
||||||
logger.error("Array out of bounds for: {}", rec, e);
|
logger.error("Array out of bounds for: {}", rec, e);
|
||||||
}
|
}
|
||||||
@@ -192,7 +192,7 @@ public class NetworkingGameClientHandler extends ChannelInboundHandlerAdapter {
|
|||||||
|
|
||||||
new EventFlow()
|
new EventFlow()
|
||||||
.addPostEvent(new NetworkEvents.YourTurnResponse(this.connectionId, msg))
|
.addPostEvent(new NetworkEvents.YourTurnResponse(this.connectionId, msg))
|
||||||
.postEvent();
|
.asyncPostEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void playerlistHandler(String rec) {
|
private void playerlistHandler(String rec) {
|
||||||
@@ -205,7 +205,7 @@ public class NetworkingGameClientHandler extends ChannelInboundHandlerAdapter {
|
|||||||
|
|
||||||
new EventFlow()
|
new EventFlow()
|
||||||
.addPostEvent(new NetworkEvents.PlayerlistResponse(this.connectionId, players))
|
.addPostEvent(new NetworkEvents.PlayerlistResponse(this.connectionId, players))
|
||||||
.postEvent();
|
.asyncPostEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void gamelistHandler(String rec) {
|
private void gamelistHandler(String rec) {
|
||||||
@@ -218,7 +218,7 @@ public class NetworkingGameClientHandler extends ChannelInboundHandlerAdapter {
|
|||||||
|
|
||||||
new EventFlow()
|
new EventFlow()
|
||||||
.addPostEvent(new NetworkEvents.GamelistResponse(this.connectionId, gameTypes))
|
.addPostEvent(new NetworkEvents.GamelistResponse(this.connectionId, gameTypes))
|
||||||
.postEvent();
|
.asyncPostEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void helpHandler(String rec) {
|
private void helpHandler(String rec) {
|
||||||
|
|||||||
Reference in New Issue
Block a user