Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Assign ServerConnection to Player before enabling auto read (#1309)
Dieser Commit ist enthalten in:
Ursprung
410636a305
Commit
aa4e8780bd
@ -137,12 +137,14 @@ public class TransitionSessionHandler implements MinecraftSessionHandler {
|
|||||||
smc.setActiveSessionHandler(StateRegistry.PLAY,
|
smc.setActiveSessionHandler(StateRegistry.PLAY,
|
||||||
new BackendPlaySessionHandler(server, serverConn));
|
new BackendPlaySessionHandler(server, serverConn));
|
||||||
|
|
||||||
// Clean up disabling auto-read while the connected event was being processed.
|
|
||||||
smc.setAutoReading(true);
|
|
||||||
|
|
||||||
// Now set the connected server.
|
// Now set the connected server.
|
||||||
serverConn.getPlayer().setConnectedServer(serverConn);
|
serverConn.getPlayer().setConnectedServer(serverConn);
|
||||||
|
|
||||||
|
// Clean up disabling auto-read while the connected event was being processed.
|
||||||
|
// Do this after setting the connection, so no incoming packets are processed before
|
||||||
|
// the API knows which server the player is connected to.
|
||||||
|
smc.setAutoReading(true);
|
||||||
|
|
||||||
// Send client settings. In 1.20.2+ this is done in the config state.
|
// Send client settings. In 1.20.2+ this is done in the config state.
|
||||||
if (smc.getProtocolVersion().lessThan(ProtocolVersion.MINECRAFT_1_20_2)
|
if (smc.getProtocolVersion().lessThan(ProtocolVersion.MINECRAFT_1_20_2)
|
||||||
&& player.getClientSettingsPacket() != null) {
|
&& player.getClientSettingsPacket() != null) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren