How To Join A Room

To join a room, you need the room ID of the room. You will probably need to store room IDs externally or use Match Maker to share room IDs. Also we recommend your message include the sender’s user ID and other necessary information so that the recipients may detect who has joined and behave accordingly. When you join a room, OnJoin will be raised. Other members’ clients of the room will raise OnMemberJoin.  If a UDP client is used, the message is sent as an RUDP.

 

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); // This message will be sent to the other members when you join the room successfully. Other members will receive the message via OnMemberJoin event
room.Join(roomID, message);