NetworkBuffer now has valid parameter

Removed NetworkBuffer variable in NetworkMessage
TcpClient DataAvailable parameter type is now int32
Fixed NetworkMessage::EncododeMessage to put the size in the Buffer's header and to validate and fixed DecodeMessage to check the buffer's valid variable
Fixed some methods in TcpClientWindows
This commit is contained in:
xX-TheDoctor-Xx
2016-08-15 01:08:41 +01:00
parent e3de0a1489
commit fcc5c570e1
5 changed files with 80 additions and 61 deletions

View File

@ -12,7 +12,7 @@ struct NetworkMessage
{
NetworkMessage();
NetworkMessage(const NetworkBuffer &buffer);
NetworkMessage(uint16 sender, byte distribution_mode, uint16 destination_id, byte tag, byte subject, NetworkBuffer buffer);
NetworkMessage(uint16 sender, byte distribution_mode, uint16 destination_id, byte tag, byte subject);
~NetworkMessage();
static const NetworkBuffer &EncodeMessage(const NetworkMessage &message);
@ -27,9 +27,6 @@ struct NetworkMessage
void *data;
bool valid = false;
private:
NetworkBuffer buffer;
};
#endif