public Room(IntPtr o) { ApplicationID = CAPI.ovr_Room_GetApplicationID(o); DataStore = CAPI.DataStoreFromNative(CAPI.ovr_Room_GetDataStore(o)); Description = CAPI.ovr_Room_GetDescription(o); ID = CAPI.ovr_Room_GetID(o); { var pointer = CAPI.ovr_Room_GetInvitedUsers(o); InvitedUsers = new UserList(pointer); if (pointer == IntPtr.Zero) { InvitedUsersOptional = null; } else { InvitedUsersOptional = InvitedUsers; } } IsMembershipLocked = CAPI.ovr_Room_GetIsMembershipLocked(o); JoinPolicy = CAPI.ovr_Room_GetJoinPolicy(o); Joinability = CAPI.ovr_Room_GetJoinability(o); { var pointer = CAPI.ovr_Room_GetMatchedUsers(o); MatchedUsers = new MatchmakingEnqueuedUserList(pointer); if (pointer == IntPtr.Zero) { MatchedUsersOptional = null; } else { MatchedUsersOptional = MatchedUsers; } } MaxUsers = CAPI.ovr_Room_GetMaxUsers(o); Name = CAPI.ovr_Room_GetName(o); { var pointer = CAPI.ovr_Room_GetOwner(o); Owner = new User(pointer); if (pointer == IntPtr.Zero) { OwnerOptional = null; } else { OwnerOptional = Owner; } } { var pointer = CAPI.ovr_Room_GetTeams(o); Teams = new TeamList(pointer); if (pointer == IntPtr.Zero) { TeamsOptional = null; } else { TeamsOptional = Teams; } } Type = CAPI.ovr_Room_GetType(o); { var pointer = CAPI.ovr_Room_GetUsers(o); Users = new UserList(pointer); if (pointer == IntPtr.Zero) { UsersOptional = null; } else { UsersOptional = Users; } } Version = CAPI.ovr_Room_GetVersion(o); }
public Room(IntPtr o) { ID = CAPI.ovr_Room_GetID(o); ApplicationID = CAPI.ovr_Room_GetApplicationID(o); DataStore = CAPI.DataStoreFromNative(CAPI.ovr_Room_GetDataStore(o)); Description = CAPI.ovr_Room_GetDescription(o); IsMembershipLocked = CAPI.ovr_Room_GetIsMembershipLocked(o); JoinPolicy = CAPI.ovr_Room_GetJoinPolicy(o); Joinability = CAPI.ovr_Room_GetJoinability(o); MaxUsers = CAPI.ovr_Room_GetMaxUsers(o); Name = CAPI.ovr_Room_GetName(o); Owner = new User(CAPI.ovr_Room_GetOwner(o)); Type = CAPI.ovr_Room_GetType(o); Users = new UserList(CAPI.ovr_Room_GetUsers(o)); Version = CAPI.ovr_Room_GetVersion(o); }
private void OnDeserializedMethod(StreamingContext context) { if (_DataStoreRawArray != null) { DataStore = new Dictionary <string, string>(); foreach (Pair pair in _DataStoreRawArray) { DataStore[pair._Key] = pair._Value; } _DataStoreRawArray = null; } //Handle RoomType if ("MATCHMAKING".Equals(_TypeRaw)) { _Type = RoomType.Matchmaking; } else if ("MODERATED".Equals(_TypeRaw)) { _Type = RoomType.Moderated; } else if ("PRIVATE".Equals(_TypeRaw)) { _Type = RoomType.Private; } else if ("SOLO".Equals(_TypeRaw)) { _Type = RoomType.Solo; } else { _Type = RoomType.Unknown; } _TypeRaw = null; //Handle JoinPolicy if ("EVERYONE".Equals(_JoinPolicyRaw)) { _JoinPolicy = JoinPolicy.Everyone; } else if ("FRIENDS_OF_MEMBERS".Equals(_JoinPolicyRaw)) { _JoinPolicy = JoinPolicy.FriendsOfMembers; } else if ("FRIENDS_OF_OWNER".Equals(_JoinPolicyRaw)) { _JoinPolicy = JoinPolicy.FriendsOfOwner; } else if ("INVITED_USERS".Equals(_JoinPolicyRaw)) { _JoinPolicy = JoinPolicy.InvitedUsers; } else { _JoinPolicy = JoinPolicy.None; } _JoinPolicyRaw = null; //Handle Joinability if ("ARE_IN".Equals(_JoinabilityRaw)) { _Joinability = RoomJoinability.AreIn; } else if ("ARE_KICKED".Equals(_JoinabilityRaw)) { _Joinability = RoomJoinability.AreKicked; } else if ("CAN_JOIN".Equals(_JoinabilityRaw)) { _Joinability = RoomJoinability.CanJoin; } else if ("IS_FULL".Equals(_JoinabilityRaw)) { _Joinability = RoomJoinability.IsFull; } else if ("NO_VIEWER".Equals(_JoinabilityRaw)) { _Joinability = RoomJoinability.NoViewer; } else if ("POLICY_PREVENTS".Equals(_JoinabilityRaw)) { _Joinability = RoomJoinability.PolicyPrevents; } else { _Joinability = RoomJoinability.Unknown; } _JoinabilityRaw = null; }