Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Merge branch 'dev/1.1.0' into future/1.16.2-velocity-1.1.0
Dieser Commit ist enthalten in:
Commit
cb4555fa70
@ -157,12 +157,12 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
|
|||||||
logger.error("{}: read timed out", association);
|
logger.error("{}: read timed out", association);
|
||||||
} else {
|
} else {
|
||||||
boolean isQuietDecoderException = cause instanceof QuietDecoderException;
|
boolean isQuietDecoderException = cause instanceof QuietDecoderException;
|
||||||
boolean willLogQuietDecoderException = isQuietDecoderException
|
boolean willLogQuietDecoderException = !isQuietDecoderException
|
||||||
&& !(sessionHandler instanceof LoginSessionHandler)
|
|| (!(sessionHandler instanceof LoginSessionHandler)
|
||||||
&& !(sessionHandler instanceof HandshakeSessionHandler);
|
&& !(sessionHandler instanceof HandshakeSessionHandler));
|
||||||
if (willLogQuietDecoderException) {
|
if (willLogQuietDecoderException) {
|
||||||
logger.error("{}: exception encountered in {}", association, sessionHandler, cause);
|
logger.error("{}: exception encountered in {}", association, sessionHandler, cause);
|
||||||
} else if (isQuietDecoderException) {
|
} else {
|
||||||
knownDisconnect = true;
|
knownDisconnect = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ public class PlayerListItem implements MinecraftPacket {
|
|||||||
item.setProperties(ProtocolUtils.readProperties(buf));
|
item.setProperties(ProtocolUtils.readProperties(buf));
|
||||||
item.setGameMode(ProtocolUtils.readVarInt(buf));
|
item.setGameMode(ProtocolUtils.readVarInt(buf));
|
||||||
item.setLatency(ProtocolUtils.readVarInt(buf));
|
item.setLatency(ProtocolUtils.readVarInt(buf));
|
||||||
item.setDisplayName(readOptionalComponent(buf));
|
item.setDisplayName(readOptionalComponent(buf, version));
|
||||||
break;
|
break;
|
||||||
case UPDATE_GAMEMODE:
|
case UPDATE_GAMEMODE:
|
||||||
item.setGameMode(ProtocolUtils.readVarInt(buf));
|
item.setGameMode(ProtocolUtils.readVarInt(buf));
|
||||||
@ -67,7 +67,7 @@ public class PlayerListItem implements MinecraftPacket {
|
|||||||
item.setLatency(ProtocolUtils.readVarInt(buf));
|
item.setLatency(ProtocolUtils.readVarInt(buf));
|
||||||
break;
|
break;
|
||||||
case UPDATE_DISPLAY_NAME:
|
case UPDATE_DISPLAY_NAME:
|
||||||
item.setDisplayName(readOptionalComponent(buf));
|
item.setDisplayName(readOptionalComponent(buf, version));
|
||||||
break;
|
break;
|
||||||
case REMOVE_PLAYER:
|
case REMOVE_PLAYER:
|
||||||
//Do nothing, all that is needed is the uuid
|
//Do nothing, all that is needed is the uuid
|
||||||
@ -85,9 +85,10 @@ public class PlayerListItem implements MinecraftPacket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static @Nullable Component readOptionalComponent(ByteBuf buf) {
|
private static @Nullable Component readOptionalComponent(ByteBuf buf, ProtocolVersion version) {
|
||||||
if (buf.readBoolean()) {
|
if (buf.readBoolean()) {
|
||||||
return GsonComponentSerializer.gson().deserialize(ProtocolUtils.readString(buf));
|
return ProtocolUtils.getJsonChatSerializer(version)
|
||||||
|
.deserialize(ProtocolUtils.readString(buf));
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren