2012-01-29 14:28:19 -05:00
|
|
|
|
|
|
|
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
|
|
|
|
2011-10-03 14:41:19 -04:00
|
|
|
#include "cPacket_BlockPlace.h"
|
2011-12-21 15:42:34 -05:00
|
|
|
#include "cPacket_ItemData.h"
|
2011-10-03 14:41:19 -04:00
|
|
|
|
2012-01-29 14:28:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-07 15:49:52 -05:00
|
|
|
int cPacket_BlockPlace::Parse(const char * a_Data, int a_Size)
|
2011-10-03 14:41:19 -04:00
|
|
|
{
|
2012-02-07 15:49:52 -05:00
|
|
|
int TotalBytes = 0;
|
|
|
|
HANDLE_PACKET_READ(ReadInteger, m_PosX, TotalBytes);
|
|
|
|
HANDLE_PACKET_READ(ReadByte, m_PosY, TotalBytes);
|
|
|
|
HANDLE_PACKET_READ(ReadInteger, m_PosZ, TotalBytes);
|
|
|
|
HANDLE_PACKET_READ(ReadByte, m_Direction, TotalBytes);
|
2011-12-21 15:42:34 -05:00
|
|
|
|
|
|
|
cPacket_ItemData Item;
|
2012-02-07 15:49:52 -05:00
|
|
|
int res = Item.Parse(a_Data + TotalBytes, a_Size - TotalBytes);
|
|
|
|
if (res < 0)
|
|
|
|
{
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
TotalBytes += res;
|
2011-12-21 15:42:34 -05:00
|
|
|
|
|
|
|
m_ItemType = Item.m_ItemID;
|
2012-02-07 15:49:52 -05:00
|
|
|
m_Count = Item.m_ItemCount;
|
|
|
|
m_Uses = Item.m_ItemUses;
|
|
|
|
|
|
|
|
return TotalBytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-21 15:42:34 -05:00
|
|
|
|