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