Reliable message should now be working, further testing is to be done.
This commit is contained in:
@@ -35,11 +35,11 @@ void Packet::Init(MessageType type, unsigned int & packetID)
|
||||
m_Offset = 0;
|
||||
// Create message header
|
||||
// allocate memory for size of packet(only used in tcp)
|
||||
Packet::WritePrimitive<int>(0);
|
||||
WritePrimitive<int>(0);
|
||||
// Add message type
|
||||
int messageType = static_cast<int>(type);
|
||||
Packet::WritePrimitive<int>(messageType);
|
||||
Packet::WritePrimitive<int>(packetID);
|
||||
WritePrimitive<int>(messageType);
|
||||
WritePrimitive<int>(packetID);
|
||||
packetID++;
|
||||
m_HeaderSize = m_Offset;
|
||||
}
|
||||
@@ -98,6 +98,7 @@ void Packet::ReconstructFromData(char * data, int sizeOfData)
|
||||
|
||||
void Packet::UpdateSize()
|
||||
{
|
||||
int whatisoffset = m_Offset;
|
||||
memcpy(m_Data, &m_Offset, sizeof(int));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user