Defined in:Base class for all message types.
class Message : public ListElement<Message>, public Memory<MessageMgr>
||Returns the dynamic type identifier of a message.|
||Returns flags indicating whether a message requires special handling.|
||Sets flags indicating whether a message requires special handling.|
||Called by the Message Manager to compress and serialize message data into a memory buffer.|
||Called by the Message Manager to decompress and validate message data stored in a memory buffer.|
||Called by the Message Manager to respond to a received message.|
Message(MessageType type, uint32 flags = 0);
||The type of message.|
||The message flags.|
DescriptionEvery type of message is encapsulated by a subclass of the
typeparameter passed to the
Messageconstructor identifies the type of message being constructed and should be passed in from the constructor of a subclass.
Each subclass of the
Messageclass must implement the following three functions.
- A default constructor that takes no parameters. When the Message Manager receives a message having an application-defined type, it calls the
Application::CreateMessagefunction with the message type, and this function should return a newly created
Messagesubclass corresponding to that type. The default constructor should not initialize any data fields because the Message Manager subsequently calls the object's
DecompressMessagefunction to initialize the object using data from the received network packet.
CompressMessagefunction. The Message Manager calls this function to compress and serialize the message into a buffer that will be sent as a data packet.
DecompressMessagefunction. The Message Manager calls this function to decompress a data packet into the message object and validate its contents.
Messageclass may have, in addition to the default constructor, constructors that take initializers. Such a constructor would be useful for creating a new message that is to be sent to another machine.
||Used internally by the Message Manager.|
||Memory for |