How To Broadcast A Message To All Members Of Room

Broadcasting will send a message to all members of the room including yourself. The message will be received by OnMemberBroadcast. We recommend your message includes the senders user ID and other information so that the recipients may detect who has sent the message and behave accordingly.

 

NOTE: encoder shown here is an example and the client SDK does not include it.

messageData.SenderID = id;
messageData.Message = "Hello";
byte[] message = encoder.Encode(messageData);
bool reliable = false; // for UDP, if set to true, broadcast message will be sent as an RUDP packet
room.BroadcastTo(room.GetRoomID(), message, reliable);