Defer ByteBufUtil.getBytes() in config stages until after we check for channel registry
This commit is contained in:
+1
-1
@@ -277,7 +277,6 @@ public class ConfigSessionHandler implements MinecraftSessionHandler {
|
||||
PluginMessageUtil.rewriteMinecraftBrand(packet, server.getVersion(),
|
||||
serverConn.getPlayer().getProtocolVersion()));
|
||||
} else {
|
||||
byte[] bytes = ByteBufUtil.getBytes(packet.content());
|
||||
ChannelIdentifier id = this.server.getChannelRegistrar().getFromId(packet.getChannel());
|
||||
|
||||
if (id == null) {
|
||||
@@ -287,6 +286,7 @@ public class ConfigSessionHandler implements MinecraftSessionHandler {
|
||||
|
||||
// Handling this stuff async means that we should probably pause
|
||||
// the connection while we toss this off into another pool
|
||||
byte[] bytes = ByteBufUtil.getBytes(packet.content());
|
||||
this.serverConn.getConnection().setAutoReading(false);
|
||||
this.server.getEventManager()
|
||||
.fire(new PluginMessageEvent(serverConn, serverConn.getPlayer(), id, bytes))
|
||||
|
||||
+1
-1
@@ -135,7 +135,6 @@ public class ClientConfigSessionHandler implements MinecraftSessionHandler {
|
||||
} else if (BungeeCordMessageResponder.isBungeeCordMessage(packet)) {
|
||||
return true;
|
||||
} else if (serverConn != null) {
|
||||
byte[] bytes = ByteBufUtil.getBytes(packet.content());
|
||||
ChannelIdentifier id = this.server.getChannelRegistrar().getFromId(packet.getChannel());
|
||||
|
||||
if (id == null) {
|
||||
@@ -145,6 +144,7 @@ public class ClientConfigSessionHandler implements MinecraftSessionHandler {
|
||||
|
||||
// Handling this stuff async means that we should probably pause
|
||||
// the connection while we toss this off into another pool
|
||||
byte[] bytes = ByteBufUtil.getBytes(packet.content());
|
||||
serverConn.getPlayer().getConnection().setAutoReading(false);
|
||||
this.server.getEventManager()
|
||||
.fire(new PluginMessageEvent(serverConn.getPlayer(), serverConn, id, bytes))
|
||||
|
||||
Reference in New Issue
Block a user