Defined in:Called when an application-defined message is received.
virtual void ReceiveMessage(Player *sender, const NetworkAddress& address, const Message *message);
||The player from whom the message originated.|
||The address of the machine from which the message originated. This is only valid for connectionless messages.|
||The message being received.|
DescriptionWhen the Message Manager receives a message with an application-defined type, it calls
ReceiveMessageso that the application module may handle the message in whatever way it needs to. The implementation of the
ReceiveMessagefunction should determine the type of the message object pointed to by the
messageparameter by calling
Message::GetMessageTypeand then handle the message appropriately.
If a connection exists with the sending machine, the
senderparameter contains a pointer to the sending player. (On client machines, this player will always represent the server.) If the received message was sent without a connection, then the
nullptr, and the network address of the sending machine is given by the