| StrixNetworkJoinRoom Method (RoomJoinArgs, RoomJoinEventHandler, FailureEventHandler, RequestConfig) | 
Namespace: SoftGear.Strix.Unity.Runtime
 Syntax
Syntaxpublic void JoinRoom( RoomJoinArgs args, RoomJoinEventHandler handler, FailureEventHandler failureHandler, RequestConfig config = null )
 Remarks
Remarks| ErrorCodeException | Strix error which can be further separated by an error code: 
 | ||||||||||||||||||||||||||
| SocketException | An error occurred when attempting to access the socket. | ||||||||||||||||||||||||||
| WebException | There has been an error when connecting to the authentication server. It's either an HTTP error such as 404/Not Found, or a network error like failure to resolve a DNS entry, a socket error, etc. | ||||||||||||||||||||||||||
| ArgumentException | When using an authentication server this error can happen if the server returns an invalid authorization token. It could be an invalid UTF-8 string or an invalid JSON. | ||||||||||||||||||||||||||
| Exception | This can happen if the address for the given host couldn't be resolved when establishing socket connection. | 
 Examples
Examplesusing SoftGear.Strix.Client.Core.Model.Manager.Filter; using SoftGear.Strix.Unity.Runtime; using System.Collections.Generic; using System.Linq; using UnityEngine; public class StrixJoinRoomExample : MonoBehaviour { void Start() { var strixNetwork = StrixNetwork.instance; strixNetwork.applicationId = "00000000-0000-0000-0000-000000000000"; strixNetwork.ConnectMasterServer( host: "0123456789abcdef01234567.game.strixcloud.net", connectEventHandler: _ => { Debug.Log("Connection established."); strixNetwork.SearchJoinableRoom( condition: null, order: new Order("memberCount", OrderType.Ascending), limit: 10, offset: 0, handler: searchResults => { var foundRooms = searchResults.roomInfoCollection; Debug.Log(foundRooms.Count + " rooms found."); if (foundRooms.Count == 0) { Debug.LogError("No joinable rooms found."); return; } var roomInfo = foundRooms.First(); strixNetwork.JoinRoom( args: new RoomJoinArgs { host = roomInfo.host, port = roomInfo.port, protocol = roomInfo.protocol, roomId = roomInfo.roomId, memberProperties = new RoomMemberProperties { name = "My Player Name", properties = new Dictionary<string, object> { { "hairColor", "green" } } } }, handler: __ => Debug.Log("Room joined."), failureHandler: joinError => Debug.LogError("Join failed. Reason: " + joinError.cause) ); }, failureHandler: searchError => Debug.LogError("Search failed. Reason: " + searchError.cause) ); }, errorEventHandler: connectError => Debug.LogError("Connection failed. Reason: " + connectError.cause) ); } }
 See Also
See Also