Ejemplo n.º 1
0
        public UserIdentity GetUserIdentityFromSession(string id)
        {
            if (id == null || id == ((UserIdentity)m_UISessionStateData.userIdentity).matchmakerId)
            {
                return((UserIdentity)m_UISessionStateData.userIdentity);
            }
            else
            {
                for (int i = 0; i < m_UISessionStateData.rooms.Length; i++)
                {
                    ProjectRoom projectRoom = (ProjectRoom)m_UISessionStateData.rooms[i];
                    for (int j = 0; j < projectRoom.users.Count; j++)
                    {
                        if (projectRoom.users[j].matchmakerId == id)
                        {
                            return(projectRoom.users[j]);
                        }
                    }
                }

                ProjectRoom linkSharedProjectRoom = (ProjectRoom)m_UISessionStateData.linkSharedProjectRoom;
                for (int j = 0; j < linkSharedProjectRoom.users.Count; j++)
                {
                    if (linkSharedProjectRoom.users[j].matchmakerId == id)
                    {
                        return(linkSharedProjectRoom.users[j]);
                    }
                }
            }

            m_SessionStateContextTarget.UpdateWith(ref m_UISessionStateData, UpdateNotification.ForceNotify);
            return(default);
Ejemplo n.º 2
0
 public SessionState(LoginState loggedState, UnityUser user, ProjectRoom[] rooms)
 {
     this.loggedState      = loggedState;
     this.user             = user;
     this.rooms            = rooms;
     userIdentity          = default;
     linkShareLoggedOut    = false;
     linkSharePermission   = LinkPermission.Private;
     isInPrivateMode       = false;
     collaborationState    = CollaborationState.Disconnected;
     linkSharedProjectRoom = default;
 }