Archiviert
1
0

Fix missing value read

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2022-01-31 21:20:19 +01:00
Ursprung 75e744435c
Commit 70056b838e

Datei anzeigen

@ -101,13 +101,18 @@ public class Forge extends BasicListener {
} }
//for more information see https://wiki.vg/Minecraft_Forge_Handshake#FML2_protocol_.281.13_-_Current.29 //for more information see https://wiki.vg/Minecraft_Forge_Handshake#FML2_protocol_.281.13_-_Current.29
Utils.VarInt length = Utils.readVarInt(data, 0); Utils.VarInt channelLength = Utils.readVarInt(data, 0);
assert length.length + length.value == data.length; int pos = channelLength.length;
assert new String(data, pos, channelLength.value).equals("fml:handshake");
Utils.VarInt packetId = Utils.readVarInt(data, length.length); Utils.VarInt length = Utils.readVarInt(data, pos);
pos += length.length;
assert channelLength.length + channelLength.value + length.length + length.value == data.length;
Utils.VarInt packetId = Utils.readVarInt(data, pos);
pos += packetId.length;
assert packetId.value == 2; assert packetId.value == 2;
int pos = length.length + packetId.length;
Utils.VarInt modCount = Utils.readVarInt(data, pos); Utils.VarInt modCount = Utils.readVarInt(data, pos);
pos += modCount.length; pos += modCount.length;