Creating rooms
To create a room, there are two methods you can call: CreateRoom
, and CreateJoinRoom
. The CreateRoom
method takes the desired room name (or null if you want a random room name), and room parameters (a dictionary of room properties, such as time limit, map, password, and so on). The CreateJoinRoom
method takes both the properties of CreateRoom
, and the properties of JoinRoom
, as it will either join the room if it exists or create a new one.
One thing to note is that CreateRoom
will not automatically establish a connection. It simply returns a string of the room ID on success, and then this is used to connect via JoinRoom
.
void OnGUI() { if( roomConnection != null ) return; if( GUILayout.Button( "Create Room", GUILayout.Width( 200f ) ) ) { // "MyCode" is the default room type provided with the Serverside Code solution client.Multiplayer.CreateRoom( null, "MyCode", true, null, delegate( string roomID ) { Debug.Log( "Room created" ); ...