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
ReceiveMessage so that the application module may handle the message in whatever way it needs to. The implementation of the
ReceiveMessage function should determine the type of the message object pointed to by the
message parameter by calling
Message::GetMessageType and then handle the message appropriately.
If a connection exists with the sending machine, the
sender parameter 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
sender parameter is
nullptr, and the network address of the sending machine is given by the