From eb3ed1aec1fb9e4468a7829cabd42572b7554d70 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 19 Aug 2012 11:51:17 +0000 Subject: Another handful of packets rewritten. Also changed cItem::m_ItemID into m_ItemType of type short. Easier handling. m_ItemID kept for compatibility reasons (Lua-interface etc.) git-svn-id: http://mc-server.googlecode.com/svn/trunk@756 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/packets/cPacket_Player.cpp | 48 +++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'source/packets/cPacket_Player.cpp') diff --git a/source/packets/cPacket_Player.cpp b/source/packets/cPacket_Player.cpp index 3a897a1ea..c24905e15 100644 --- a/source/packets/cPacket_Player.cpp +++ b/source/packets/cPacket_Player.cpp @@ -106,10 +106,10 @@ void cPacket_PlayerListItem::Serialize(AString & a_Data) const cPacket_PlayerLook::cPacket_PlayerLook( cPlayer* a_Player ) { - m_PacketID = E_PLAYERLOOK; - m_Rotation = a_Player->GetRotation(); - m_Pitch = a_Player->GetPitch(); - m_bFlying = a_Player->GetFlying(); + m_PacketID = E_PLAYERLOOK; + m_Rotation = a_Player->GetRotation(); + m_Pitch = a_Player->GetPitch(); + m_IsOnGround = a_Player->IsOnGround(); } @@ -119,9 +119,9 @@ cPacket_PlayerLook::cPacket_PlayerLook( cPlayer* a_Player ) int cPacket_PlayerLook::Parse(cByteBuffer & a_Buffer) { int TotalBytes = 0; - HANDLE_PACKET_READ(ReadBEFloat, m_Rotation, TotalBytes); - HANDLE_PACKET_READ(ReadBEFloat, m_Pitch, TotalBytes); - HANDLE_PACKET_READ(ReadBool, m_bFlying, TotalBytes); + HANDLE_PACKET_READ(ReadBEFloat, m_Rotation, TotalBytes); + HANDLE_PACKET_READ(ReadBEFloat, m_Pitch, TotalBytes); + HANDLE_PACKET_READ(ReadBool, m_IsOnGround, TotalBytes); return TotalBytes; } @@ -134,7 +134,7 @@ void cPacket_PlayerLook::Serialize(AString & a_Data) const AppendByte (a_Data, m_PacketID); AppendFloat (a_Data, m_Rotation); AppendFloat (a_Data, m_Pitch); - AppendBool (a_Data, m_bFlying); + AppendBool (a_Data, m_IsOnGround); } @@ -145,14 +145,14 @@ void cPacket_PlayerLook::Serialize(AString & a_Data) const cPacket_PlayerMoveLook::cPacket_PlayerMoveLook( cPlayer* a_Player ) { - m_PacketID = E_PLAYERMOVELOOK; - m_PosX = a_Player->GetPosX(); - m_PosY = a_Player->GetPosY() + 1.65; - m_PosZ = a_Player->GetPosZ(); - m_Stance = a_Player->GetStance(); - m_Rotation = a_Player->GetRotation(); - m_Pitch = a_Player->GetPitch(); - m_bFlying = a_Player->GetFlying(); + m_PacketID = E_PLAYERMOVELOOK; + m_PosX = a_Player->GetPosX(); + m_PosY = a_Player->GetPosY() + 1.65; + m_PosZ = a_Player->GetPosZ(); + m_Stance = a_Player->GetStance(); + m_Rotation = a_Player->GetRotation(); + m_Pitch = a_Player->GetPitch(); + m_IsOnGround = a_Player->IsOnGround(); } @@ -162,13 +162,13 @@ cPacket_PlayerMoveLook::cPacket_PlayerMoveLook( cPlayer* a_Player ) int cPacket_PlayerMoveLook::Parse(cByteBuffer & a_Buffer) { int TotalBytes = 0; - HANDLE_PACKET_READ(ReadBEDouble, m_PosX, TotalBytes); - HANDLE_PACKET_READ(ReadBEDouble, m_PosY, TotalBytes); - HANDLE_PACKET_READ(ReadBEDouble, m_Stance, TotalBytes); - HANDLE_PACKET_READ(ReadBEDouble, m_PosZ, TotalBytes); - HANDLE_PACKET_READ(ReadBEFloat, m_Rotation, TotalBytes); - HANDLE_PACKET_READ(ReadBEFloat, m_Pitch, TotalBytes); - HANDLE_PACKET_READ(ReadBool, m_bFlying, TotalBytes); + HANDLE_PACKET_READ(ReadBEDouble, m_PosX, TotalBytes); + HANDLE_PACKET_READ(ReadBEDouble, m_PosY, TotalBytes); + HANDLE_PACKET_READ(ReadBEDouble, m_Stance, TotalBytes); + HANDLE_PACKET_READ(ReadBEDouble, m_PosZ, TotalBytes); + HANDLE_PACKET_READ(ReadBEFloat, m_Rotation, TotalBytes); + HANDLE_PACKET_READ(ReadBEFloat, m_Pitch, TotalBytes); + HANDLE_PACKET_READ(ReadBool, m_IsOnGround, TotalBytes); return TotalBytes; } @@ -185,7 +185,7 @@ void cPacket_PlayerMoveLook::Serialize(AString & a_Data) const AppendDouble(a_Data, m_PosZ); AppendFloat (a_Data, m_Rotation); AppendFloat (a_Data, m_Pitch); - AppendBool (a_Data, m_bFlying); + AppendBool (a_Data, m_IsOnGround); } -- cgit v1.2.3