Added packet loss logic for multiple clients.

Changed packet class to fit our needs.
This commit is contained in:
Jocke
2016-01-20 13:43:11 +01:00
parent 85523343b2
commit f52cddb445
6 changed files with 58 additions and 28 deletions
+2 -1
View File
@@ -14,6 +14,7 @@ public:
Packet(MessageType type, unsigned int& packetID);
// Used to create packet from already existing data buffer.
Packet(char* data, const int sizeOfPacket);
Packet(MessageType type);
~Packet();
void Init(MessageType type, unsigned int& packetID);
@@ -49,7 +50,7 @@ public:
// Pops the first element as if it was a string.
std::string ReadString();
char* ReadData(int SizeOfData);
void ChangePacketID(unsigned int& packetID);
int Size() { return m_Offset; };
char* Data() { return m_Data; };
unsigned int DataReadSize() { return m_ReturnDataOffset; }