geforkt von Mirrors/Velocity
Do a better job of passing channel (un)registration to the client.
Also fixes a regression related to WDLCompanion.
Dieser Commit ist enthalten in:
Ursprung
552f02ed60
Commit
a21eaa085a
@ -95,8 +95,12 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
|
|||||||
// the client.
|
// the client.
|
||||||
if (PluginMessageUtil.isRegister(packet)) {
|
if (PluginMessageUtil.isRegister(packet)) {
|
||||||
serverConn.getPlayer().getKnownChannels().addAll(PluginMessageUtil.getChannels(packet));
|
serverConn.getPlayer().getKnownChannels().addAll(PluginMessageUtil.getChannels(packet));
|
||||||
|
serverConn.getPlayer().getMinecraftConnection().write(packet);
|
||||||
|
return true;
|
||||||
} else if (PluginMessageUtil.isUnregister(packet)) {
|
} else if (PluginMessageUtil.isUnregister(packet)) {
|
||||||
serverConn.getPlayer().getKnownChannels().removeAll(PluginMessageUtil.getChannels(packet));
|
serverConn.getPlayer().getKnownChannels().removeAll(PluginMessageUtil.getChannels(packet));
|
||||||
|
serverConn.getPlayer().getMinecraftConnection().write(packet);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PluginMessageUtil.isMcBrand(packet)) {
|
if (PluginMessageUtil.isMcBrand(packet)) {
|
||||||
|
@ -47,7 +47,7 @@ public class PluginMessage implements MinecraftPacket {
|
|||||||
@Override
|
@Override
|
||||||
public void decode(ByteBuf buf, ProtocolUtils.Direction direction, ProtocolVersion version) {
|
public void decode(ByteBuf buf, ProtocolUtils.Direction direction, ProtocolVersion version) {
|
||||||
this.channel = ProtocolUtils.readString(buf);
|
this.channel = ProtocolUtils.readString(buf);
|
||||||
if (version.compareTo(ProtocolVersion.MINECRAFT_1_13) < 0) {
|
if (version.compareTo(ProtocolVersion.MINECRAFT_1_13) >= 0) {
|
||||||
this.channel = transformLegacyToModernChannel(this.channel);
|
this.channel = transformLegacyToModernChannel(this.channel);
|
||||||
}
|
}
|
||||||
this.data = new byte[buf.readableBytes()];
|
this.data = new byte[buf.readableBytes()];
|
||||||
@ -59,8 +59,11 @@ public class PluginMessage implements MinecraftPacket {
|
|||||||
if (channel == null) {
|
if (channel == null) {
|
||||||
throw new IllegalStateException("Channel is not specified.");
|
throw new IllegalStateException("Channel is not specified.");
|
||||||
}
|
}
|
||||||
ProtocolUtils.writeString(buf, version.compareTo(ProtocolVersion.MINECRAFT_1_13) >= 0
|
if (version.compareTo(ProtocolVersion.MINECRAFT_1_13) >= 0) {
|
||||||
? channel : transformLegacyToModernChannel(this.channel));
|
ProtocolUtils.writeString(buf, transformLegacyToModernChannel(this.channel));
|
||||||
|
} else {
|
||||||
|
ProtocolUtils.writeString(buf, this.channel);
|
||||||
|
}
|
||||||
buf.writeBytes(data);
|
buf.writeBytes(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren