Every Compat (Wood Good)

Every Compat (Wood Good)

3M Downloads

[๐Ÿž]: `mod_version_check_packet` breaks Velocity proxy support

Sander0542 opened this issue ยท 5 comments

commented

Before Continuing:

  • Always check you are using the latest version of the mods and its dependencies
  • Remove mod that enhances Minecraft: Optifine, Sodium, others. The issue still persists.
  • If you are unsure which mod is the culprit.
    Disable all of your mods and enable them 1-2 mods each time to isolate the culprit
  • Confirm that there is no existing issue with a similar description submitted in the list of issues.

Version

1.20.1

Loader

Forge

EveryCompat Version

everycomp-1.20-2.6.66

Moonlight Lib Version

moonlight-1.20-2.12.6-forge

Issue with mods

Velocity 3.0.0

This is not another mod, but a minecraft server proxy.

Issue Detail

When the mod_version_check_packet setting is enabled, this mod sends a packet to the server to query the correct versions. This packet contains the Integer.MIN_VALUE which causes the proxy to disconnect the client.

The following section of code causes the client to disconnect

@SubscribeEvent
public void onPlayerNegotiation(PlayerNegotiationEvent playerNegotiationEvent) {
if(ModConfigs.CHECK_PACKET.get()) {
((ChannelHandlerImpl) ECNetworking.CHANNEL).channel.sendTo(new ECNetworking.S2CModVersionCheckMessage(),
playerNegotiationEvent.getConnection(),
NetworkDirection.LOGIN_TO_CLIENT
);
}

More information can be found in the following ticket: PaperMC/Velocity#1370

OPTIONAL: Latest.log | Crash-report Attachment

The following log comes from the Velocity proxy, not the mod.

[20:18:40] [Netty epoll Worker #1/ERROR] [com.velocitypowered.proxy.connection.MinecraftConnection]: [server connection] Sander0542 -> valhelsia6: exception encountered in org.adde0109.ambassador.velocity.backend.ForgeLoginSessionHandler@e1cc3f2
io.netty.handler.codec.CorruptedFrameException: Error decoding class com.velocitypowered.proxy.protocol.packet.LoginPluginMessagePacket Direction CLIENTBOUND Protocol 1.20 State LOGIN ID 4
	at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.handleDecodeFailure(MinecraftDecoder.java:130) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.tryDecode(MinecraftDecoder.java:85) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.channelRead(MinecraftDecoder.java:60) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:509) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at java.base/java.lang.Thread.run(Unknown Source) [?:?]
Caused by: io.netty.handler.codec.CorruptedFrameException: Bad VarInt decoded
	at com.velocitypowered.proxy.protocol.ProtocolUtils.readVarInt(ProtocolUtils.java:132) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at com.velocitypowered.proxy.protocol.packet.LoginPluginMessagePacket.decode(LoginPluginMessagePacket.java:66) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.tryDecode(MinecraftDecoder.java:83) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-9d25d309-b400)]
	... 24 more

OPTIONAL: To Produce

  1. Configure Velocity and the backend Forge server.
  2. Connect to the proxy server, which forwards the connection to the backend Forge server.
  3. Get disconnected because of an invalid packet.
commented

U need to update your EveryComp to the latest version, v2.6.72 & Moonlight Lib to v2.12.14.
Try test them to see if the issue persist.

commented

Hm what? Integer min value where? That packet works and thus must be valid for vanilla so I don't see how it could be our issue.
The packet contains a map of strings and map encoding is done by vanilla code. If there's any integer is there. Rest is strings.

public S2CModVersionCheckMessage(FriendlyByteBuf buf) {

commented

Any news on this issue?