Try fix BadPackets

This commit is contained in:
BruceChen 2022-10-10 15:32:39 +08:00
parent 7fba4fb9ab
commit dee085686f
3 changed files with 7 additions and 10 deletions

View file

@ -938,7 +938,7 @@ namespace MinecraftClient.Protocol.Handlers
{
List<byte> bytes = new()
{
(byte)Convert.ToByte(paramBool)
Convert.ToByte(paramBool)
};
return bytes.ToArray();
}

View file

@ -353,8 +353,7 @@ namespace MinecraftClient.Protocol.Handlers
handler.OnServerKeepAlive();
break;
case PacketTypesIn.Ping:
int ID = dataTypes.ReadNextInt(packetData);
SendPacket(PacketTypesOut.Pong, dataTypes.GetInt(ID));
SendPacket(PacketTypesOut.Pong, packetData);
break;
case PacketTypesIn.JoinGame:
handler.OnGameJoined();
@ -1383,10 +1382,8 @@ namespace MinecraftClient.Protocol.Handlers
byte windowID = dataTypes.ReadNextByte(packetData);
short actionID = dataTypes.ReadNextShort(packetData);
bool accepted = dataTypes.ReadNextBool(packetData);
if (!accepted)
{
if (!accepted && actionID > 0)
SendWindowConfirmation(windowID, actionID, accepted);
}
}
break;
case PacketTypesIn.ResourcePackSend: