Ejemplo n.º 1
0
        /// <summary>
        /// Loop through all (pending) replies for avatar properties
        /// and do something as yet unknown to me (gwyneth 20220120)
        /// </summary>
        /// <param name="sender">parameter ignored</param>
        /// <param name="e">List of avatar properties</param>
        /// <returns>void</returns>
        /// <remarks>updated for new callbacks</remarks>
        public void AvatarPropertiesReply(
            object?sender,
            AvatarPropertiesReplyEventArgs e
            )
        {
            /*
             * AvatarPropertiesReplyPacket reply = (AvatarPropertiesReplyPacket)packet;
             * bool status = false;
             * if ( (reply.PropertiesData.Flags & 1 << 4 ) != 0 ) {
             *      status = true;
             * } else {
             *      status = false;
             * }
             */
            Avatar.AvatarProperties Properties = new Avatar.AvatarProperties();
            Properties = e.Properties;

            DebugUtilities
            .WriteInfo($"{session} {MethodName} Processing AvatarPropertiesReply for {e.AvatarID.ToString()} is {Properties.Online.ToString()}");
            lock (avatarOnline)
            {
                avatarOnline[e.AvatarID] = Properties.Online;
            }
            if (OnlineLookupEvents.ContainsKey(e.AvatarID))
            {
                OnlineLookupEvents[e.AvatarID].Set();
            }
        }
Ejemplo n.º 2
0
        public override void Avatars_OnAvatarProperties(object sender, AvatarPropertiesReplyEventArgs e)
        {
            SimAvatar A = DeclareAvatarProfile(e.AvatarID);

            if (!MaintainAvatarMetaData)
            {
                return;
            }
            A.ProfileProperties = e.Properties;
            UUID propertiesPartner = e.Properties.Partner;

            if (propertiesPartner != UUID.Zero)
            {
                SimAvatarImpl AA = DeclareAvatarProfile(propertiesPartner);
                //if (AA.GetName() == null)
                //{
                //    String s = GetUserName(propertiesPartner);
                //    AA.AspectName = s;
                //}
            }
            if (e.Properties.ProfileImage != UUID.Zero)
            {
                // RequestAsset(properties.ProfileImage, AssetType.Texture, true);
            }
            //TODO SendNewEvent("On-Avatar-Properties", GetAvatar(avatarID, null), properties);
        }
Ejemplo n.º 3
0
        private void Avatars_AvatarPropertiesReply(object sender, AvatarPropertiesReplyEventArgs e)
        {
            Properties_AV = e.Properties;

            profile_get.Set();

            BotSession.Instance.grid.Avatars.AvatarPropertiesReply -= Avatars_AvatarPropertiesReply;
        }
Ejemplo n.º 4
0
        void Avatars_AvatarPropertiesReply(object sender, AvatarPropertiesReplyEventArgs e)
        {
            lock (ReceivedProfileEvent)
            {
                Properties         = e.Properties;
                ReceivedProperties = true;

                if (ReceivedInterests && ReceivedProperties && ReceivedGroups)
                {
                    ReceivedProfileEvent.Set();
                }
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Loop through all (pending) replies for avatar profiles
 /// and process them if they contain any key for the avatar we're looking up.
 /// </summary>
 /// <param name="sender">parameter ignored</param>
 /// <param name="e">List of UUID/Avatar names</param>
 /// <returns>void</returns>
 /// <remarks>changed to deal with new replies</remarks>
 public void Avatars_OnAvatarProperties(
     object?sender,
     AvatarPropertiesReplyEventArgs e
     )
 {
     lock (avatarProfile)
     {
         avatarProfile[e.AvatarID] = e.Properties;
     }
     if (ProfileLookupEvents.ContainsKey(e.AvatarID))
     {
         ProfileLookupEvents[e.AvatarID].Set();
     }
 }
        private void Avatars_AvatarPropertiesReply(object sender, AvatarPropertiesReplyEventArgs e)
        {
            if (e.AvatarID != targetID)
            {
                return;
            }
            lock (ReceivedProfileEvent)
            {
                Properties         = e.Properties;
                ReceivedProperties = true;

                if (ReceivedInterests && ReceivedProperties && ReceivedGroups)
                {
                    ReceivedProfileEvent.Set();
                }
            }
        }
Ejemplo n.º 7
0
 void Avatars_AvatarPropertiesReply(object sender, AvatarPropertiesReplyEventArgs e)
 {
     if (e.AvatarID == Client.Self.AgentID && AimlLoaded)
     {
         MyProfile = e.Properties;
         Alice.GlobalSettings.updateSetting("birthday", MyProfile.BornOn);
         DateTime bd;
         if (DateTime.TryParse(MyProfile.BornOn, Utils.EnUsCulture, System.Globalization.DateTimeStyles.None, out bd))
         {
             DateTime now = DateTime.Today;
             int      age = now.Year - bd.Year;
             if (now.Month < bd.Month || (now.Month == bd.Month && now.Day < bd.Day))
             {
                 --age;
             }
             Alice.GlobalSettings.updateSetting("age", age.ToString());
             Alice.GlobalSettings.updateSetting("birthday", bd.ToLongDateString());
         }
     }
 }
Ejemplo n.º 8
0
        void Avatars_OnAvatarProperties(object sender, AvatarPropertiesReplyEventArgs e)
        {
            //if (avatarID == client.Self.AgentID)
            //{
            //    myProfile = properties;
            //    Alice.GlobalSettings.updateSetting("birthday", myProfile.BornOn);
            //    DateTime bd;
            //    if (DateTime.TryParse(myProfile.BornOn, Utils.EnUsCulture, System.Globalization.DateTimeStyles.None, out bd))
            //    {
            //        DateTime now = DateTime.Today;
            //        int age = now.Year - bd.Year;
            //        if (now.Month < bd.Month || (now.Month == bd.Month && now.Day < bd.Day))
            //        {
            //            --age;
            //        }
            //        Alice.GlobalSettings.updateSetting("age", age.ToString());
            //        Alice.GlobalSettings.updateSetting("birthday", bd.ToLongDateString());

            //    }
            //}
        }
Ejemplo n.º 9
0
        void Avatars_AvatarPropertiesReply(object sender, AvatarPropertiesReplyEventArgs e)
        {
            if (e.AvatarID != agentID)
            {
                return;
            }

            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => Avatars_AvatarPropertiesReply(sender, e)));
                return;
            }
            Profile = e.Properties;

            FLImageID = e.Properties.FirstLifeImage;
            SLImageID = e.Properties.ProfileImage;

            if (agentID == client.Self.AgentID || SLImageID != UUID.Zero)
            {
                SLImageHandler pic = new SLImageHandler(instance, SLImageID, "");

                if (agentID == client.Self.AgentID)
                {
                    pic.AllowUpdateImage = true;
                    pic.ImageUpdated    += (usender, ue) =>
                    {
                        Profile.ProfileImage = ue.NewImageID;
                        pic.UpdateImage(ue.NewImageID);
                        client.Self.UpdateProfile(Profile);
                    };
                }

                pic.Dock     = DockStyle.Fill;
                pic.SizeMode = PictureBoxSizeMode.StretchImage;
                slPicPanel.Controls.Add(pic);
                slPicPanel.Show();
            }
            else
            {
                slPicPanel.Hide();
            }

            if (agentID == client.Self.AgentID || FLImageID != UUID.Zero)
            {
                SLImageHandler pic = new SLImageHandler(instance, FLImageID, "");
                pic.Dock = DockStyle.Fill;

                if (agentID == client.Self.AgentID)
                {
                    pic.AllowUpdateImage = true;
                    pic.ImageUpdated    += (usender, ue) =>
                    {
                        Profile.FirstLifeImage = ue.NewImageID;
                        pic.UpdateImage(ue.NewImageID);
                        client.Self.UpdateProfile(Profile);
                    };
                }

                rlPicPanel.Controls.Add(pic);
                rlPicPanel.Show();
            }
            else
            {
                rlPicPanel.Hide();
            }

            this.BeginInvoke(
                new OnSetProfileProperties(SetProfileProperties),
                new object[] { e.Properties });
        }
Ejemplo n.º 10
0
        //comes in on separate thread
        private void Avatars_OnAvatarProperties(object sender, AvatarPropertiesReplyEventArgs e)
        {
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => Avatars_OnAvatarProperties(sender, e)));
                return;
            }

            if (e.AvatarID != agentID)
            {
                return;
            }

            props = e.Properties;

            FLImageID = props.FirstLifeImage;
            SLImageID = props.ProfileImage;

            if (instance.avtags.ContainsKey(e.AvatarID))
            {
                try
                {
                    string atag = instance.avtags[e.AvatarID];
                    txtTag.Text = atag;
                }
                catch {; }
            }
            else
            {
                txtTag.Text = "avatar out of range";
            }

            if (SLImageID != UUID.Zero)
            {
                if (!instance.ImageCache.ContainsImage(SLImageID))
                {
                    client.Assets.RequestImage(SLImageID, ImageType.Normal, Assets_OnImageReceived);
                }
                else
                {
                    BeginInvoke(
                        new OnSetProfileImage(SetProfileImage),
                        new object[] { SLImageID, instance.ImageCache.GetImage(SLImageID) });
                }
            }
            else
            {
                BeginInvoke(new MethodInvoker(SetBlankSLImage));
            }

            if (FLImageID != UUID.Zero)
            {
                if (!instance.ImageCache.ContainsImage(FLImageID))
                {
                    client.Assets.RequestImage(FLImageID, ImageType.Normal, Assets_OnImageReceived);
                }
                else
                {
                    BeginInvoke(
                        new OnSetProfileImage(SetProfileImage),
                        new object[] { FLImageID, instance.ImageCache.GetImage(FLImageID) });
                }
            }
            else
            {
                BeginInvoke(new MethodInvoker(SetBlankFLImage));
            }

            this.BeginInvoke(
                new OnSetProfileProperties(SetProfileProperties),
                new object[] { props });
        }