SendMessageToClient(recieverClientId, yourMessage)

Type
Function

Description

This function sends a single message to a particular client in your server. This is very useful in some games where you only want to send one signal at a time.

The Receiver’s client id should be the integer client id of the client you want to send a message to.

📌
Please make sure the message is a string! If you want to share more detailed information in this message, turn it into a struct and json_stringify it and then send that string.

Where will the receiver get this message?

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

image