コード例 #1
0
ファイル: Profile.cs プロジェクト: TooheyPaneer/radegast
        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 });
        }
コード例 #2
0
ファイル: Alice.cs プロジェクト: Nuriat/radegast
        void Avatars_AvatarPropertiesReply(object sender, AvatarPropertiesReplyEventArgs e)
        {
            if (e.AvatarID == Client.Self.AgentID)
            {
                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());

                }
            }
        }
コード例 #3
0
 ///<summary>Raises the AvatarPropertiesReply Event</summary>
 /// <param name="e">A AvatarPropertiesReplyEventArgs object containing
 /// the data sent from the simulator</param>
 protected virtual void OnAvatarPropertiesReply(AvatarPropertiesReplyEventArgs e)
 {
     EventHandler<AvatarPropertiesReplyEventArgs> handler = m_AvatarPropertiesReply;
     if (handler != null)
         handler(this, e);
 }
コード例 #4
0
        void Avatars_AvatarPropertiesReply(object sender, AvatarPropertiesReplyEventArgs e)
        {
            if(e.AvatarID!=	resident)
                return;

            Gtk.Application.Invoke(delegate {

            this.label_born.Text=e.Properties.BornOn;

            partner_key=e.Properties.Partner;

            if(e.Properties.Online)
                this.label_status.Text="Online";
            else
                this.label_status.Text="Offline";

            if(e.Properties.Transacted)
                this.label_pay.Text="Pay info on file";
            else
                this.label_pay.Text="No";

            if(e.Properties.Identified)
                this.label_identified.Text="Yes";
            else
                this.label_identified.Text="No";

            this.textview2.Buffer.Text=e.Properties.AboutText;

            this.textview3.Buffer.Text=e.Properties.FirstLifeText;

            profile_pic=e.Properties.ProfileImage;
            firstlife_pic=e.Properties.FirstLifeImage;

            TryGetImage getter= new TryGetImage(this.image7,profile_pic,128,128,false);
            TryGetImage getter2= new TryGetImage(this.image3,firstlife_pic,128,128,false);

            if(MainClass.name_cache.av_names.ContainsKey(e.AvatarID))
            {
                this.label_name.Text=MainClass.name_cache.av_names[e.AvatarID];
            }
            else
            {
                MainClass.client.Avatars.RequestAvatarName(e.AvatarID);
                this.label_name.Text="Waiting....";
            }

            if(e.Properties.Partner!=UUID.Zero)
            {
                if(MainClass.name_cache.av_names.ContainsKey(partner_key))
                {
                    this.label_partner.Text=MainClass.name_cache.av_names[partner_key];
                }
                else
                {
                    MainClass.client.Avatars.RequestAvatarName(partner_key);
                    this.label_partner.Text="Waiting....";
                }
            }
            });
        }
コード例 #5
0
ファイル: Profile.cs プロジェクト: RevolutionSmythe/radegast
        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 (SLImageID != UUID.Zero)
            {
                SLImageHandler pic = new SLImageHandler(instance, SLImageID, "");
                pic.Dock = DockStyle.Fill;
                pic.SizeMode = PictureBoxSizeMode.StretchImage;
                slPicPanel.Controls.Add(pic);
                slPicPanel.Show();
            }
            else
            {
                slPicPanel.Hide();
            }

            if (FLImageID != UUID.Zero)
            {
                SLImageHandler pic = new SLImageHandler(instance, FLImageID, "");
                pic.Dock = DockStyle.Fill;
                rlPicPanel.Controls.Add(pic);
                rlPicPanel.Show();
            }
            else
            {
                rlPicPanel.Hide();
            }

            this.BeginInvoke(
                new OnSetProfileProperties(SetProfileProperties),
                new object[] { e.Properties });
        }
コード例 #6
0
ファイル: Profile.cs プロジェクト: NullProjects/METAbolt
        //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 });
        }
コード例 #7
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());

            //    }
            //}
        }
コード例 #8
0
ファイル: AllEvents.cs プロジェクト: drzo/opensim4opencog
 public virtual void Avatars_OnAvatarProperties(object sender, AvatarPropertiesReplyEventArgs e) { OnEvent("On-Avatar-Properties", paramNamesOnAvatarProperties, paramTypesOnAvatarProperties, e); }
コード例 #9
0
 // changed to deal with new replies
 public void Avatars_OnAvatarProperties(object sender, AvatarPropertiesReplyEventArgs e)
 {
     lock (avatarProfile) {
         avatarProfile[e.AvatarID] = e.Properties;
     }
     if ( ProfileLookupEvents.ContainsKey(e.AvatarID) ) {
         ProfileLookupEvents[e.AvatarID].Set();
     }
 }
コード例 #10
0
        // updated for new callbacks
        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();
            }
        }
コード例 #11
0
        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();
            }
        }
コード例 #12
0
        void Avatars_AvatarPropertiesReply(object sender, AvatarPropertiesReplyEventArgs e)
        {
            lock (ReceivedProfileEvent)
            {
                Properties = e.Properties;
                ReceivedProperties = true;

                if (ReceivedInterests && ReceivedProperties && ReceivedGroups)
                    ReceivedProfileEvent.Set();
            }
        }