#include <messagepacket.h>
Public Types | |
| typedef GNE::SmartPtr < MessagePacket > | sptr |
| typedef GNE::WeakPtr < MessagePacket > | wptr |
Public Member Functions | |
| MessagePacket () | |
| Constructor. | |
| MessagePacket (const MessagePacket &messagePacket) | |
| Copy constructor, used by the GNE::PacketParser to send a copy of the MessagePacket across the Network. | |
| MessagePacket (const dtGame::Message &message) | |
| Construct a MessagePacket from a dtGame::Message. | |
| virtual | ~MessagePacket (void) |
| Destructor, public for GNE...... | |
| virtual void | writePacket (GNE::Buffer &raw) const |
| Writes a MessagePacket into a packet stream, used by GNE::PacketParser. | |
| virtual void | readPacket (GNE::Buffer &raw) |
| Reads a MessagePacket from a packet stream, used by GNE::PacketParser. | |
| virtual int | getSize () const |
| Gets the size of the MessagePacket, used by GNE::PacketParser. | |
| void | BuildFromMessage (const dtGame::Message &message) |
| Builds a MessagePacket from a message. | |
| void | FillMessage (dtGame::Message &message) const |
| Fills the content of the encapsulated Message into a Message, The message should be created using the MessageFactory. | |
| const unsigned short | GetMessageId () const |
| Gets the MessageType::mID of the Message contained in the MessagePacket This can be used to recreate the message with the Messagefactory. | |
| const dtCore::UniqueId | GetDestinatonId () const |
| Gets the UniqueId of the Message destination. | |
| const dtCore::UniqueId | GetSourceId () const |
| Gets the UniqueId of the Message source. | |
| const std::string | GetMessageParameters () const |
| Gets the message parameters as string. | |
| void | OverrideDestination (const dtGame::MachineInfo &destination) |
| Overrides the destination of the contained Message. | |
Static Public Attributes | |
| static const int | ID = GNE::PacketParser::MIN_USER_ID |
| ID used by GNE to identify the MessagePacket. | |
The MessagePacket uses the dtGame::MachineInfo::UniqueId to specify its source and destination dtGame::GameManager Currently it is assumed all messagecontent fits into one packet.
| typedef GNE::SmartPtr<MessagePacket> dtNetGM::MessagePacket::sptr |
| typedef GNE::WeakPtr<MessagePacket> dtNetGM::MessagePacket::wptr |
| dtNetGM::MessagePacket::MessagePacket | ( | ) |
Constructor.
| dtNetGM::MessagePacket::MessagePacket | ( | const MessagePacket & | messagePacket | ) |
Copy constructor, used by the GNE::PacketParser to send a copy of the MessagePacket across the Network.
| messagePacket | the MessagePacket to be copied. |
| dtNetGM::MessagePacket::MessagePacket | ( | const dtGame::Message & | message | ) |
Construct a MessagePacket from a dtGame::Message.
| message | the Message to be contained in the MessagePacket. |
| dtNetGM::MessagePacket::~MessagePacket | ( | void | ) | [virtual] |
Destructor, public for GNE......
| void dtNetGM::MessagePacket::writePacket | ( | GNE::Buffer & | raw | ) | const [virtual] |
Writes a MessagePacket into a packet stream, used by GNE::PacketParser.
| raw | The buffer to write the MessagePacket to |
| void dtNetGM::MessagePacket::readPacket | ( | GNE::Buffer & | raw | ) | [virtual] |
Reads a MessagePacket from a packet stream, used by GNE::PacketParser.
| raw | The buffer to read the MessagePacket from |
| int dtNetGM::MessagePacket::getSize | ( | ) | const [virtual] |
| void dtNetGM::MessagePacket::BuildFromMessage | ( | const dtGame::Message & | message | ) |
Builds a MessagePacket from a message.
| the | message to be encapsulated by the MessagePacket |
| void dtNetGM::MessagePacket::FillMessage | ( | dtGame::Message & | message | ) | const |
Fills the content of the encapsulated Message into a Message, The message should be created using the MessageFactory.
| The | message to write the content to. |
| const unsigned short dtNetGM::MessagePacket::GetMessageId | ( | ) | const [inline] |
Gets the MessageType::mID of the Message contained in the MessagePacket This can be used to recreate the message with the Messagefactory.
| const dtCore::UniqueId dtNetGM::MessagePacket::GetDestinatonId | ( | ) | const [inline] |
Gets the UniqueId of the Message destination.
| const dtCore::UniqueId dtNetGM::MessagePacket::GetSourceId | ( | ) | const [inline] |
Gets the UniqueId of the Message source.
| const std::string dtNetGM::MessagePacket::GetMessageParameters | ( | ) | const [inline] |
Gets the message parameters as string.
| void dtNetGM::MessagePacket::OverrideDestination | ( | const dtGame::MachineInfo & | destination | ) |
Overrides the destination of the contained Message.
| The | new destination |
const int dtNetGM::MessagePacket::ID = GNE::PacketParser::MIN_USER_ID [static] |
ID used by GNE to identify the MessagePacket.
The MessagePacket has an ID of GNE::PacketParser::MIN_USER_ID