callback_ReceivedMessage
After a successful message send on your server, the callback function callback_ReceivedMessage() is called. So under Scripts/Rocket Networking/Callback Functions , you can edit this to do whatever you want…
Example Implementation of callback
In a shooter game, if you hit another player, you want to inform them that their health reduced right?
You can send a message called "damage"
The receiver can see the message and use the switch statement to reude their player's health by 10 if the message is "damage"
More Complex Systems
As I talked about a switch statement here, you can make a full event based system encoded in the message.
To do that, you can make a struct and stringify it and send it over to the reciever.
On any reciever's screen, you have to reduce the health right? So you can do this in the calback_ReceivedMessage() script
Last updated