Pyrogenesis
trunk
|
The base class for all network messages exchanged within the game. More...
#include <NetMessage.h>
Public Member Functions | |
CNetMessage () | |
CNetMessage (NetMessageType type) | |
virtual | ~CNetMessage () |
NetMessageType | GetType () const |
Retrieves the message type. More... | |
virtual u8 * | Serialize (u8 *pBuffer) const |
Serialize the message into the specified buffer parameter. More... | |
virtual const u8 * | Deserialize (const u8 *pStart, const u8 *pEnd) |
Deserializes the message from the specified buffer. More... | |
virtual size_t | GetSerializedLength () const |
Retrieves the size in bytes of the serialized message. More... | |
virtual CStr | ToString () const |
Returns a string representation for the message. More... | |
Public Member Functions inherited from ISerializable | |
virtual | ~ISerializable () |
Private Attributes | |
NetMessageType | m_Type |
Friends | |
class | CNetSession |
The base class for all network messages exchanged within the game.
CNetMessage::CNetMessage | ( | ) |
CNetMessage::CNetMessage | ( | NetMessageType | type | ) |
|
virtual |
Deserializes the message from the specified buffer.
pStart | Message start within the serialized buffer |
pEnd | Message end within the serialized buffer |
Implements ISerializable.
Reimplemented in CGameSetupMessage, and CSimulationMessage.
|
virtual |
Retrieves the size in bytes of the serialized message.
Before calling Serialize, the memory size for the buffer where to serialize the message object can be found by calling this method.
Implements ISerializable.
Reimplemented in CGameSetupMessage, and CSimulationMessage.
|
inline |
Retrieves the message type.
Serialize the message into the specified buffer parameter.
The size required by the buffer parameter can be found by a call to GetSerializedLength method. The information contained within the message must be serialized before the message is sent. By default only the message type and its size are serialized in the buffer parameter.
pBuffer | Buffer where to serialize the message |
Implements ISerializable.
Reimplemented in CGameSetupMessage, and CSimulationMessage.
|
virtual |
Returns a string representation for the message.
Reimplemented in CGameSetupMessage, and CSimulationMessage.
|
friend |
|
private |