Aurora.Addon.HyperGrid.RobustOpenProfileModule.GetUserProfile C# (CSharp) Method

GetUserProfile() public method

public GetUserProfile ( UUID agentID ) : Aurora.Framework.IUserProfileInfo
agentID UUID
return Aurora.Framework.IUserProfileInfo
        public IUserProfileInfo GetUserProfile(UUID agentID)
        {
            int created = 0;
            uint flags = 0x00;
            IUserAccountService accountService = m_registry.RequestModuleInterface<IUserAccountService>();
            var account = accountService.GetUserAccount(null, agentID);
            if (null != account)
                created = account.Created;
            else
            {
                Dictionary<string, object> userInfo;
                if (GetUserProfileData(agentID, out userInfo))
                    created = (int)userInfo["user_created"];
            }

            Hashtable profileData = GetProfileData(agentID);
            string profileUrl = string.Empty;
            string aboutText = String.Empty;
            string firstLifeAboutText = String.Empty;
            UUID image = UUID.Zero;
            UUID firstLifeImage = UUID.Zero;
            UUID partner = UUID.Zero;
            uint wantMask = 0;
            string wantText = String.Empty;
            uint skillsMask = 0;
            string skillsText = String.Empty;
            string languages = String.Empty;

            if (profileData["ProfileUrl"] != null)
                profileUrl = profileData["ProfileUrl"].ToString();
            if (profileData["AboutText"] != null)
                aboutText = profileData["AboutText"].ToString();
            if (profileData["FirstLifeAboutText"] != null)
                firstLifeAboutText = profileData["FirstLifeAboutText"].ToString();
            if (profileData["Image"] != null)
                image = new UUID(profileData["Image"].ToString());
            if (profileData["FirstLifeImage"] != null)
                firstLifeImage = new UUID(profileData["FirstLifeImage"].ToString());
            if (profileData["Partner"] != null)
                partner = new UUID(profileData["Partner"].ToString());

            //Viewer expects interest data when it asks for properties.
            if (profileData["wantmask"] != null)
                wantMask = Convert.ToUInt32(profileData["wantmask"].ToString());
            if (profileData["wanttext"] != null)
                wantText = profileData["wanttext"].ToString();

            if (profileData["skillsmask"] != null)
                skillsMask = Convert.ToUInt32(profileData["skillsmask"].ToString());
            if (profileData["skillstext"] != null)
                skillsText = profileData["skillstext"].ToString();

            if (profileData["languages"] != null)
                languages = profileData["languages"].ToString();

            return new IUserProfileInfo
            {
                AboutText = aboutText,
                Created = created,
                FirstLifeAboutText = firstLifeAboutText,
                FirstLifeImage = firstLifeImage,
                Image = image,
                Interests = new ProfileInterests() { WantToMask = wantMask, WantToText = wantText, CanDoMask = skillsMask, CanDoText = skillsText, Languages = languages },
                PrincipalID = agentID,
                WebURL = profileUrl
            };
        }