From f721ed0e3c6be33670fe330c029a2d4c3353f635 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Wed, 31 May 2017 19:17:09 +0500 Subject: 2017-05-31 --- src/packet/PacketParser.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/packet/PacketParser.cpp') diff --git a/src/packet/PacketParser.cpp b/src/packet/PacketParser.cpp index 488c812..a609011 100644 --- a/src/packet/PacketParser.cpp +++ b/src/packet/PacketParser.cpp @@ -21,7 +21,8 @@ void PacketParser::Parse(Packet &packet, ConnectionState state, bool ClientBound } void PacketParser::ParseServerBound(Packet &packet, ConnectionState state) { - throw 107; + if (packet.GetLength() != state) + throw 107; } void PacketParser::ParseLogin(Packet &packet) { @@ -32,9 +33,8 @@ void PacketParser::ParseLogin(Packet &packet) { case 0x02: ParseLogin0x02(packet); break; - default: - { - int i = packet.GetId(); + default: { + //throw 112; } } @@ -94,7 +94,7 @@ void PacketParser::ParsePlay0x23(Packet &packet) { } void PacketParser::ParsePlay0x1F(Packet &packet) { - packet.ParseField(VarInt); + packet.ParseField(VarIntType); } void PacketParser::ParsePlay0x0D(Packet &packet) { @@ -118,7 +118,7 @@ void PacketParser::ParsePlay0x2E(Packet &packet) { packet.ParseField(Float); packet.ParseField(Float); packet.ParseField(Byte8_t); - packet.ParseField(VarInt); + packet.ParseField(VarIntType); } void PacketParser::ParsePlay0x1A(Packet &packet) { @@ -129,19 +129,19 @@ void PacketParser::ParsePlay0x20(Packet &packet) { packet.ParseField(Int); packet.ParseField(Int); packet.ParseField(Boolean); - packet.ParseField(VarInt); - packet.ParseField(VarInt); + packet.ParseField(VarIntType); + packet.ParseField(VarIntType); packet.ParseField(ByteArray, packet.GetField(4).GetVarInt()); - packet.ParseField(VarInt); + packet.ParseField(VarIntType); //packet.ParseField(NbtTag); //packet.GetField(7).SetArray(packet.GetField(6).GetVarInt()); } void PacketParser::ParsePlay0x07(Packet &packet) { - packet.ParseField(VarInt); + packet.ParseField(VarIntType); packet.AddField(Field()); - for (int i=0;i