Skip to content

Commit

Permalink
Pass through packets in config phase
Browse files Browse the repository at this point in the history
  • Loading branch information
valaphee committed Nov 14, 2024
1 parent cefa3b2 commit 32c5baf
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ public boolean handle(final PluginMessagePacket packet) {
// but at this time the backend server may not be ready
} else if (serverConn != null) {
serverConn.ensureConnected().write(packet.retain());
return true;
}
return true;

return false;
}

@Override
Expand All @@ -141,14 +143,17 @@ public boolean handle(PingIdentifyPacket packet) {

@Override
public boolean handle(KnownPacksPacket packet) {
callConfigurationEvent().thenRun(() -> {
player.getConnectionInFlightOrConnectedServer().ensureConnected().write(packet);
}).exceptionally(ex -> {
logger.error("Error forwarding known packs response to backend:", ex);
return null;
});
if (player.getConnectionInFlight() != null) {
callConfigurationEvent().thenRun(() -> {
player.getConnectionInFlight().ensureConnected().write(packet);
}).exceptionally(ex -> {
logger.error("Error forwarding known packs response to backend:", ex);
return null;
});
return true;
}

return true;
return false;
}

@Override
Expand Down

0 comments on commit 32c5baf

Please sign in to comment.