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

Fix config phase packets getting lost #1316

Closed
Closed
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 @@ -120,24 +120,31 @@ 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());
} else {
player.getConnection().write(packet.retain());
}
return true;
}

@Override
public boolean handle(PingIdentifyPacket packet) {
if (player.getConnectionInFlight() != null) {
player.getConnectionInFlight().ensureConnected().write(packet);
final VelocityServerConnection serverConn = player.getConnectionInFlight();
if (serverConn != null) {
serverConn.ensureConnected().write(packet);
} else {
player.getConnection().write(packet);
Copy link
Member

Choose a reason for hiding this comment

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

isn't this sending data to the wrong thing? you either want to get the connection in flight, or the connected server?

}
return true;
}

@Override
public boolean handle(KnownPacksPacket packet) {
if (player.getConnectionInFlight() != null) {
player.getConnectionInFlight().ensureConnected().write(packet);
final VelocityServerConnection serverConn = player.getConnectionInFlight();
if (serverConn != null) {
serverConn.ensureConnected().write(packet);
} else {
player.getConnection().write(packet);
}

return true;
}

Expand Down