Files
VoidNet/include/NetworkMessage.hpp
xX-TheDoctor-Xx fcc5c570e1 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
2016-08-15 01:08:41 +01:00

33 lines
652 B
C++

#ifndef NETWORK_MESSAGE_HPP
#define NETWORK_MESSAGE_HPP
#ifdef _MSC_VER
#pragma once
#endif
#include "Defs.hpp"
#include "NetworkBuffer.hpp"
struct NetworkMessage
{
NetworkMessage();
NetworkMessage(const NetworkBuffer &buffer);
NetworkMessage(uint16 sender, byte distribution_mode, uint16 destination_id, byte tag, byte subject);
~NetworkMessage();
static const NetworkBuffer &EncodeMessage(const NetworkMessage &message);
static const NetworkMessage &DecodeMessage(const NetworkBuffer &buffer);
uint16 sender = -2;
byte distribution_mode;
uint16 destination_id;
byte tag;
byte subject;
void *data;
bool valid = false;
};
#endif