Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass through packets in config phase #1459

Open
wants to merge 1 commit into
base: dev/3.0.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some aspects of this need reverting, the connection isn't always going to be inflight when we jump through configuration, but, events should still be fired, etc

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that IF could just be moved in front of

   player.getConnectionInFlight().ensureConnected().write(packet);

tho... it might affect plugins listening to config event?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would prevent plugins from being able to interact with reconfiguration while on a server, this block basically needs reverting

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