Represents an avatar (other than your own)
Inheritance: Primitive
コード例 #1
1
ファイル: TexturesCommand.cs プロジェクト: RavenB/gridsearch
        void Objects_OnNewAvatar(Simulator simulator, Avatar avatar, ulong regionHandle, ushort timeDilation)
        {
            if (enabled)
            {
                // Search this avatar for textures
                for (int i = 0; i < avatar.Textures.FaceTextures.Length; i++)
                {
                    Primitive.TextureEntryFace face = avatar.Textures.FaceTextures[i];

                    if (face != null)
                    {
                        if (!alreadyRequested.ContainsKey(face.TextureID))
                        {
                            alreadyRequested[face.TextureID] = face.TextureID;

                            // Determine if this is a baked outfit texture or a normal texture
                            ImageType type = ImageType.Normal;
                            AppearanceManager.TextureIndex index = (AppearanceManager.TextureIndex)i;
                            switch (index)
                            {
                                case AppearanceManager.TextureIndex.EyesBaked:
                                case AppearanceManager.TextureIndex.HeadBaked:
                                case AppearanceManager.TextureIndex.LowerBaked:
                                case AppearanceManager.TextureIndex.SkirtBaked:
                                case AppearanceManager.TextureIndex.UpperBaked:
                                    type = ImageType.Baked;
                                    break;
                            }

                            Client.Assets.RequestImage(face.TextureID, type);
                        }
                    }
                }
            }
        }
コード例 #2
0
ファイル: OutfitTextures.cs プロジェクト: Nuriat/radegast
        public OutfitTextures(RadegastInstance instance, Avatar avatar)
        {
            InitializeComponent();

            this.instance = instance;
            this.avatar = avatar;
        }
コード例 #3
0
ファイル: AnimDetail.cs プロジェクト: niel/radegast
 public AnimDetail(RadegastInstance instance, Avatar av, UUID anim, int n)
 {
     InitializeComponent();
     Disposed += new EventHandler(AnimDetail_Disposed);
     this.instance = instance;
     this.av = av;
     this.anim = anim;
     this.n = n;
 }
コード例 #4
0
        public OutfitTextures(RadegastInstance instance, Avatar avatar)
        {
            InitializeComponent();

            this.instance = instance;
            this.avatar = avatar;

            Radegast.GUI.GuiHelpers.ApplyGuiFixes(this);
        }
コード例 #5
0
ファイル: AttachmentTab.cs プロジェクト: Booser/radegast
        public AttachmentTab(RadegastInstance instance, Avatar iav)
        {
            this.instance = instance;
            av = iav;
            InitializeComponent();
            AutoScrollPosition = new Point(0, 0);

            InitializeComponent();
        }
コード例 #6
0
        void Avatars_OnAvatarProperties(UUID avatarID, Avatar.AvatarProperties properties)
        {
            lock (ReceivedProfileEvent)
            {
                Properties = properties;
                ReceivedProperties = true;

                if (ReceivedInterests && ReceivedProperties && ReceivedGroups)
                    ReceivedProfileEvent.Set();
            }
        }
コード例 #7
0
 void DownloadAVTextures(OpenMetaverse.Avatar a)
 {
     foreach (Primitive.TextureEntryFace TEF in a.Textures.FaceTextures)
     {
         if (TEF == null)
         {
             continue;
         }
         m_textures.DownloadTexture(TEF.TextureID);
     }
 }
コード例 #8
0
ファイル: AnimTab.cs プロジェクト: Booser/radegast
        public AnimTab(RadegastInstance instance, Avatar av)
        {
            InitializeComponent();
            Disposed += new EventHandler(AnimTab_Disposed);
            this.instance = instance;
            this.av = av;
            this.client = instance.Client;

            // Callbacks
            client.Avatars.AvatarAnimation += new EventHandler<AvatarAnimationEventArgs>(Avatars_AvatarAnimation);
        }
コード例 #9
0
ファイル: AnimDetail.cs プロジェクト: nooperation/radegast
        public AnimDetail(RadegastInstance instance, Avatar av, UUID anim, int n)
        {
            InitializeComponent();
            Disposed += new EventHandler(AnimDetail_Disposed);
            this.instance = instance;
            this.av = av;
            this.anim = anim;
            this.n = n;

            Radegast.GUI.GuiHelpers.ApplyGuiFixes(this);
        }
コード例 #10
0
        //private Dictionary<uint, AttachmentsListItem> groupItems = new Dictionary<uint, AttachmentsListItem>();
        public WornAttachments(METAboltInstance instance, Avatar av)
        {
            InitializeComponent();

            Disposed += new EventHandler(WornAttachments_Disposed);

            this.instance = instance;
            client = this.instance.Client;
            this.av = av;

            client.Network.SimChanged += new EventHandler<SimChangedEventArgs>(SIM_OnSimChanged);
            //client.Self.TeleportProgress += new EventHandler<TeleportEventArgs>(Self_TeleportProgress);
        }
コード例 #11
0
 public LLEntityAvatar(AssetContextBase acontext, LLRegionContext rcontext,
                       ulong regionHandle, OMV.Avatar av) : base(rcontext, acontext)
 {
     // base(acontext, rcontext, regionHandle, av.LocalID, null) { // base for EntityPhysical
     // let people looking at IEntity's get at my avatarness
     RegisterInterface <IEntityAvatar>(this);
     this.Sim          = rcontext.Simulator;
     this.RegionHandle = regionHandle;
     this.LocalID      = av.LocalID;
     this.Avatar       = av;
     this.Name         = AvatarEntityNameFromID(acontext, m_avatar.ID);
     LogManager.Log.Log(LogLevel.DCOMMDETAIL, "LLEntityAvatar: create id={0}, lid={1}",
                        av.ID.ToString(), this.LocalID);
 }
コード例 #12
0
    void Avatars_AvatarAppearance(object sender, AvatarAppearanceEventArgs e)
    {
        if (e.Simulator.Handle != Client.Network.CurrentSim.Handle)
        {
            return;
        }

        OpenMetaverse.Avatar a = e.Simulator.ObjectsAvatars.Find(av => av.ID == e.AvatarID);
        if (a != null)
        {
            DownloadAVTextures(a);
            avHasTex.Add(a.LocalID);
        }
    }
コード例 #13
0
    void Objects_AvatarUpdate(object sender, AvatarUpdateEventArgs e)
    {
        if (e.Avatar.PrimData.PCode == PCode.Avatar)
        {
            Debug.Log("Recieve an Avatar!!!");
        }
        Radegast.Rendering.GLAvatar ga = new Radegast.Rendering.GLAvatar();
        OpenMetaverse.Avatar        av = e.Avatar;

        Radegast.Rendering.RenderAvatar ra = new Radegast.Rendering.RenderAvatar();
        ra.avatar   = av;
        ra.glavatar = ga;

        newAvatars.Add(av.LocalID, ra);
        ra.glavatar.morph(av);
    }
コード例 #14
0
    //Receive all the avatars' models
    void Objects_AvatarUpdate(object sender, AvatarUpdateEventArgs e)
    {
        //leave other regions out temporarily
        if (e.Simulator.Handle != Client.Network.CurrentSim.Handle)
        {
            return;
        }

        Radegast.Rendering.GLAvatar ga = new Radegast.Rendering.GLAvatar();
        OpenMetaverse.Avatar        av = e.Avatar;

        Radegast.Rendering.RenderAvatar ra = new Radegast.Rendering.RenderAvatar();
        ra.avatar   = av;
        ra.glavatar = ga;

        newAvatars.Add(av.LocalID, ra);
        ra.glavatar.morph(av);
    }
コード例 #15
0
ファイル: MasterTab.cs プロジェクト: Booser/radegast
        public MasterTab(RadegastInstance instance, Avatar avatar)
        {
            InitializeComponent();
            Disposed += new EventHandler(MasterTab_Disposed);

            if (!instance.advancedDebugging)
            {
                saveBtn.Visible = false;
                texturesBtn.Visible = false;
            }

            this.instance = instance;
            this.avatar = avatar;

            // Callbacks
            client.Avatars.ViewerEffectPointAt += new EventHandler<ViewerEffectPointAtEventArgs>(Avatars_ViewerEffectPointAt);
            client.Objects.ObjectProperties += new EventHandler<ObjectPropertiesEventArgs>(Objects_ObjectProperties);
        }
コード例 #16
0
        public AttachmentDetail(RadegastInstance instance, Avatar av, Primitive attachment)
        {
            InitializeComponent();
            Disposed += new EventHandler(AttachmentDetail_Disposed);

            this.instance = instance;
            this.av = av;
            this.attachment = attachment;

            if (!instance.advancedDebugging)
            {
                btnSave.Visible = false;
                boxID.Visible = false;
                lblAttachment.Visible = false;
            }

            // Callbacks
            client.Objects.ObjectProperties += new EventHandler<ObjectPropertiesEventArgs>(Objects_ObjectProperties);
        }
コード例 #17
0
ファイル: SceneManager.cs プロジェクト: RavenB/gridsearch
        void CompleteAgentMovementHandler(Packet packet, Agent agent)
        {
            CompleteAgentMovementPacket request = (CompleteAgentMovementPacket)packet;

            // Create a representation for this agent
            Avatar avatar = new Avatar();
            avatar.ID = agent.AgentID;
            avatar.LocalID = (uint)Interlocked.Increment(ref currentLocalID);
            avatar.Position = new Vector3(128f, 128f, 25f);
            avatar.Rotation = Quaternion.Identity;
            avatar.Scale = new Vector3(1f, 1f, 3f);

            // Set the avatar name
            NameValue[] name = new NameValue[2];
            name[0] = new NameValue("FirstName", NameValue.ValueType.String, NameValue.ClassType.ReadWrite,
                NameValue.SendtoType.SimViewer, agent.FirstName);
            name[1] = new NameValue("LastName", NameValue.ValueType.String, NameValue.ClassType.ReadWrite,
                NameValue.SendtoType.SimViewer, agent.LastName);
            avatar.NameValues = name;

            // Link this avatar up with the corresponding agent
            agent.Avatar = avatar;

            // Give testers a provisionary balance of 1000L
            agent.Balance = 1000;

            AgentMovementCompletePacket complete = new AgentMovementCompletePacket();
            complete.AgentData.AgentID = agent.AgentID;
            complete.AgentData.SessionID = agent.SessionID;
            complete.Data.LookAt = Vector3.UnitX;
            complete.Data.Position = avatar.Position;
            complete.Data.RegionHandle = server.RegionHandle;
            complete.Data.Timestamp = Utils.DateTimeToUnixTime(DateTime.Now);
            complete.SimData.ChannelVersion = Utils.StringToBytes("Simian");

            agent.SendPacket(complete);

            SendLayerData(agent);
        }
コード例 #18
0
    void Avatars_AvatarAppearance(object sender, AvatarAppearanceEventArgs e)
    {
        if (Application.platform != RuntimePlatform.WindowsPlayer && Application.platform != RuntimePlatform.WindowsEditor)
        {
            return;
        }
        if (e.Simulator.Handle != Client.Network.CurrentSim.Handle)
        {
            return;
        }

        OpenMetaverse.Avatar a = e.Simulator.ObjectsAvatars.Find(av => av.ID == e.AvatarID);
        if (a != null)
        {
            DownloadAVTextures(a);
            if (!avHasTex.Contains(a.LocalID))
            {
                avHasTex.Add(a.LocalID);
            }
        }
        Debug.Log("AvatarAppearance for " + a.Name + a.LocalID.ToString());
    }
コード例 #19
0
ファイル: ObjectManager.cs プロジェクト: RavenB/gridsearch
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sim"></param>
        /// <param name="av"></param>
        /// <param name="localid"></param>
        /// <param name="oldSeatID"></param>
        protected void SetAvatarSittingOn(Simulator sim, Avatar av, uint localid, uint oldSeatID)
        {
            if (Client.Network.CurrentSim == sim && av.LocalID == Client.Self.localID)
            {
                Client.Self.sittingOn = localid;
            }

            av.ParentID = localid;


            if (m_AvatarSitChanged != null && oldSeatID != localid)
            {
                OnAvatarSitChanged(new AvatarSitChangedEventArgs(sim, av, localid, oldSeatID));
            }
        }
コード例 #20
0
ファイル: Dashboard.cs プロジェクト: RavenB/gridsearch
 private void avatarList1_OnAvatarDoubleClick(Avatar avatar)
 {
     MessageBox.Show(avatar.Name + " = " + avatar.ID);
 }
コード例 #21
0
ファイル: Viewer.cs プロジェクト: Booser/radegast
 private void OnNetworkAvatarAdd(VSimulator sim, Avatar avatar, ulong regionHandle, ushort timeDilation)
 {
     m_timeDilation = (float)(timeDilation / ushort.MaxValue);
     SceneGraph.OnNetworkAvatarAdd(sim, avatar, regionHandle, timeDilation);
 }
コード例 #22
0
        public static new Avatar FromOSD(OSD O)
        {
            OSDMap tex = (OSDMap)O;

            Avatar A = new Avatar();

            Primitive P = Primitive.FromOSD(O);

            Type Prim = typeof(Primitive);

            FieldInfo[] Fields = Prim.GetFields();

            for (int x = 0; x < Fields.Length; x++)
            {
                Logger.Log("Field Matched in FromOSD: " + Fields[x].Name, Helpers.LogLevel.Debug);
                Fields[x].SetValue(A, Fields[x].GetValue(P));
            }

            A.Groups = new List <UUID>();

            foreach (OSD U in (OSDArray)tex["groups"])
            {
                A.Groups.Add(U.AsUUID());
            }

            A.ProfileStatistics = Statistics.FromOSD(tex["profile_statistics"]);
            A.ProfileProperties = AvatarProperties.FromOSD(tex["profile_properties"]);
            A.ProfileInterests  = Interests.FromOSD(tex["profile_interest"]);
            A.ControlFlags      = (AgentManager.ControlFlags)tex["control_flags"].AsInteger();

            OSDArray vp = (OSDArray)tex["visual_parameters"];

            A.VisualParameters = new byte[vp.Count];

            for (int i = 0; i < vp.Count; i++)
            {
                A.VisualParameters[i] = (byte)vp[i].AsInteger();
            }

            // *********************From Code Above *******************************

            /*if (NameValues[i].Name == "FirstName" && NameValues[i].Type == NameValue.ValueType.String)
             *                firstName = (string)NameValues[i].Value;
             *            else if (NameValues[i].Name == "LastName" && NameValues[i].Type == NameValue.ValueType.String)
             *                lastName = (string)NameValues[i].Value;*/
            // ********************************************************************

            A.NameValues = new NameValue[3];

            NameValue First = new NameValue();

            First.Name  = "FirstName";
            First.Type  = NameValue.ValueType.String;
            First.Value = tex["first_name"].AsString();

            NameValue Last = new NameValue();

            Last.Name  = "LastName";
            Last.Type  = NameValue.ValueType.String;
            Last.Value = tex["last_name"].AsString();

            // ***************From Code Above***************
            // if (NameValues[i].Name == "Title" && NameValues[i].Type == NameValue.ValueType.String)
            // *********************************************

            NameValue Group = new NameValue();

            Group.Name  = "Title";
            Group.Type  = NameValue.ValueType.String;
            Group.Value = tex["group_name"].AsString();



            A.NameValues[0] = First;
            A.NameValues[1] = Last;
            A.NameValues[2] = Group;

            return(A);
        }
コード例 #23
0
ファイル: SLProtocol.cs プロジェクト: caocao/3di-viewer-rei
 private void newAvatarCallback(Simulator simulator, Avatar avatar, ulong regionHandle,
                                ushort timeDilation)
 {
     if (OnNewAvatar != null)
     {
        //avatar.Velocity
         OnNewAvatar(simulator,avatar,regionHandle,timeDilation);
     }
 }
コード例 #24
0
 public AvatarInterestsReplyEventArgs(UUID avatarID, Avatar.Interests interests)
 {
     this.m_AvatarID = avatarID;
     this.m_Interests = interests;
 }
コード例 #25
0
ファイル: ObjectManager.cs プロジェクト: RavenB/gridsearch
 public AvatarSitChangedEventArgs(Simulator simulator, Avatar avatar, uint sittingOn, uint oldSeat)
 {
     this.m_Simulator = simulator;
     this.m_Avatar = avatar;
     this.m_SittingOn = sittingOn;
     this.m_OldSeat = oldSeat;
 }
コード例 #26
0
ファイル: Avatar.cs プロジェクト: RavenB/gridsearch
        public static new Avatar FromOSD(OSD O)
        {

            OSDMap tex = (OSDMap)O;

            Avatar A = new Avatar();
            
            Primitive P = Primitive.FromOSD(O);

            Type Prim = typeof(Primitive);

            FieldInfo[] Fields = Prim.GetFields();

            for (int x = 0; x < Fields.Length; x++)
            {
                Logger.Log("Field Matched in FromOSD: "+Fields[x].Name, Helpers.LogLevel.Debug);
                Fields[x].SetValue(A, Fields[x].GetValue(P));
            }            

            A.Groups = new List<UUID>();

            foreach (OSD U in (OSDArray)tex["groups"])
            {
                A.Groups.Add(U.AsUUID());
            }

            A.ProfileStatistics = Statistics.FromOSD(tex["profile_statistics"]);
            A.ProfileProperties = AvatarProperties.FromOSD(tex["profile_properties"]);
            A.ProfileInterests = Interests.FromOSD(tex["profile_interest"]);
            A.ControlFlags = (AgentManager.ControlFlags)tex["control_flags"].AsInteger();

            OSDArray vp = (OSDArray)tex["visual_parameters"];
            A.VisualParameters = new byte[vp.Count];

            for (int i = 0; i < vp.Count; i++)
            {
                A.VisualParameters[i] = (byte)vp[i].AsInteger();
            }

            // *********************From Code Above *******************************
            /*if (NameValues[i].Name == "FirstName" && NameValues[i].Type == NameValue.ValueType.String)
                              firstName = (string)NameValues[i].Value;
                          else if (NameValues[i].Name == "LastName" && NameValues[i].Type == NameValue.ValueType.String)
                              lastName = (string)NameValues[i].Value;*/
            // ********************************************************************

            A.NameValues = new NameValue[3];

            NameValue First = new NameValue();
            First.Name = "FirstName";
            First.Type = NameValue.ValueType.String;
            First.Value = tex["first_name"].AsString();

            NameValue Last = new NameValue();
            Last.Name = "LastName";
            Last.Type = NameValue.ValueType.String;
            Last.Value = tex["last_name"].AsString();

            // ***************From Code Above***************
            // if (NameValues[i].Name == "Title" && NameValues[i].Type == NameValue.ValueType.String)
            // *********************************************

            NameValue Group = new NameValue();
            Group.Name = "Title";
            Group.Type = NameValue.ValueType.String;
            Group.Value = tex["group_name"].AsString();



            A.NameValues[0] = First;
            A.NameValues[1] = Last;
            A.NameValues[2] = Group;

            return A;


        }
コード例 #27
0
ファイル: AgentManager.cs プロジェクト: RavenB/gridsearch
        /// <summary>
        /// Update agent profile
        /// </summary>
        /// <param name="profile"><seealso cref="OpenMetaverse.Avatar.AvatarProperties"/> struct containing updated 
        /// profile information</param>
        public void UpdateProfile(Avatar.AvatarProperties profile)
        {
            AvatarPropertiesUpdatePacket apup = new AvatarPropertiesUpdatePacket();
            apup.AgentData.AgentID = id;
            apup.AgentData.SessionID = sessionID;
            apup.PropertiesData.AboutText = Utils.StringToBytes(profile.AboutText);
            apup.PropertiesData.AllowPublish = profile.AllowPublish;
            apup.PropertiesData.FLAboutText = Utils.StringToBytes(profile.FirstLifeText);
            apup.PropertiesData.FLImageID = profile.FirstLifeImage;
            apup.PropertiesData.ImageID = profile.ProfileImage;
            apup.PropertiesData.MaturePublish = profile.MaturePublish;
            apup.PropertiesData.ProfileURL = Utils.StringToBytes(profile.ProfileURL);

            Client.Network.SendPacket(apup);
        }
コード例 #28
0
ファイル: ObjectManager.cs プロジェクト: RavenB/gridsearch
        /// <summary>
        /// 
        /// </summary>
        /// <param name="simulator"></param>
        /// <param name="localID"></param>
        /// <param name="fullID"></param>
        /// <returns></returns>
        protected Avatar GetAvatar(Simulator simulator, uint localID, UUID fullID)
        {
            if (Client.Settings.AVATAR_TRACKING)
            {
                lock (simulator.ObjectsAvatars.Dictionary)
                {

                    Avatar avatar;

                    if (simulator.ObjectsAvatars.Dictionary.TryGetValue(localID, out avatar))
                    {
                        return avatar;
                    }
                    else
                    {
                        avatar = new Avatar();
                        avatar.LocalID = localID;
                        avatar.ID = fullID;
                        avatar.RegionHandle = simulator.Handle;

                        simulator.ObjectsAvatars.Dictionary[localID] = avatar;

                        return avatar;
                    }
                }
            }
            else
            {
                return new Avatar();
            }
        }
コード例 #29
0
ファイル: ObjectManager.cs プロジェクト: RavenB/gridsearch
 /// <summary>
 /// Construct a new instance of the AvatarUpdateEventArgs class
 /// </summary>
 /// <param name="simulator">The simulator the packet originated from</param>
 /// <param name="avatar">The <see cref="Avatar"/> data</param>
 /// <param name="timeDilation">The simulator time dilation</param>
 /// <param name="isNew">The avatar was not in the dictionary before this update</param>
 public AvatarUpdateEventArgs(Simulator simulator, Avatar avatar, ushort timeDilation, bool isNew)
 {
     this.m_Simulator = simulator;
     this.m_Avatar = avatar;
     this.m_TimeDilation = timeDilation;
     this.m_IsNew = isNew;
 }
コード例 #30
0
ファイル: AvatarList.cs プロジェクト: RavenB/gridsearch
        private void AddAvatar(uint localID, UUID avatarID, Vector3 coarsePosition, Avatar avatar)
        {
            if (!this.IsHandleCreated) return;

            if (this.InvokeRequired) this.BeginInvoke((MethodInvoker)delegate { AddAvatar(localID, avatarID, coarsePosition, avatar); });
            else
            {
                TrackedAvatar trackedAvatar = new TrackedAvatar();
                trackedAvatar.CoarseLocation = coarsePosition;
                trackedAvatar.ID = avatarID;
                trackedAvatar.ListViewItem = this.Items.Add(avatarID.ToString(), trackedAvatar.Name, null);

                string strDist = avatarID == _Client.Self.AgentID ? "--" : (int)Vector3.Distance(_Client.Self.SimPosition, coarsePosition) + "m";
                trackedAvatar.ListViewItem.SubItems.Add(strDist);

                if (avatar != null)
                {
                    trackedAvatar.Name = avatar.Name;
                    trackedAvatar.ListViewItem.Text = avatar.Name;

                    lock (_TrackedAvatars)
                        _TrackedAvatars.Add(localID, avatarID, trackedAvatar);
                }
                else
                {
                    lock (_UntrackedAvatars)
                    {
                        _UntrackedAvatars.Add(avatarID, trackedAvatar);

                        trackedAvatar.ListViewItem.ForeColor = Color.FromKnownColor(KnownColor.GrayText);

                        if (avatarID == _Client.Self.AgentID)
                        {
                            trackedAvatar.Name = _Client.Self.Name;
                            trackedAvatar.ListViewItem.Text = _Client.Self.Name;
                        }

                        else Client.Avatars.RequestAvatarName(avatarID);
                    }
                }
            }
        }
コード例 #31
0
 public AvatarPropertiesReplyEventArgs(UUID avatarID, Avatar.AvatarProperties properties)
 {
     this.m_AvatarID = avatarID;
     this.m_Properties = properties;
 }
コード例 #32
0
ファイル: AvatarList.cs プロジェクト: RavenB/gridsearch
        private void UpdateAvatar(Avatar avatar)
        {
            if (!this.IsHandleCreated) return;

            if (this.InvokeRequired) this.BeginInvoke((MethodInvoker)delegate { UpdateAvatar(avatar); });
            else
            {
                lock (_TrackedAvatars)
                {
                    TrackedAvatar trackedAvatar;

                    lock (_UntrackedAvatars)
                    {
                        if (_UntrackedAvatars.TryGetValue(avatar.ID, out trackedAvatar))
                        {
                            trackedAvatar.Name = avatar.Name;
                            trackedAvatar.ListViewItem.Text = avatar.Name;
                            trackedAvatar.ListViewItem.ForeColor = Color.FromKnownColor(KnownColor.ControlText);

                            _TrackedAvatars.Add(avatar.LocalID, avatar.ID, trackedAvatar);
                            _UntrackedAvatars.Remove(avatar.ID);
                        }
                    }
                    
                    if (_TrackedAvatars.TryGetValue(avatar.ID, out trackedAvatar))
                    {
                        trackedAvatar.Avatar = avatar;
                        trackedAvatar.Name = avatar.Name;
                        trackedAvatar.ID = avatar.ID;

                        string strDist = avatar.ID == _Client.Self.AgentID ? "--" : (int)Vector3.Distance(_Client.Self.SimPosition, avatar.Position) + "m";
                        trackedAvatar.ListViewItem.SubItems[1].Text = strDist;
                    }
                    else
                    {
                        AddAvatar(avatar.LocalID, avatar.ID, Vector3.Zero, avatar);
                    }               
                }

                this.Sort();
            }
        }
コード例 #33
0
ファイル: Profile.cs プロジェクト: TooheyPaneer/radegast
        private void SetProfileProperties(Avatar.AvatarProperties properties)
        {
            txtBornOn.Text = properties.BornOn;
            anPartner.AgentID = properties.Partner;

            if (fullName.EndsWith("Linden")) rtbAccountInfo.AppendText("Linden Lab Employee\n");
            if (properties.Identified) rtbAccountInfo.AppendText("Identified\n");
            if (properties.Transacted) rtbAccountInfo.AppendText("Transacted\n");

            rtbAbout.AppendText(properties.AboutText);

            txtWebURL.Text = properties.ProfileURL;
            btnWebView.Enabled = btnWebOpen.Enabled = (txtWebURL.TextLength > 0);

            rtbAboutFL.AppendText(properties.FirstLifeText);
        }
コード例 #34
0
ファイル: AvatarList.cs プロジェクト: RavenB/gridsearch
 void Objects_OnNewAvatar(Simulator simulator, Avatar avatar, ulong regionHandle, ushort timeDilation)
 {
     UpdateAvatar(avatar);
 }
コード例 #35
0
        private Packet ObjectUpdatePacketReceived(Packet p, IPEndPoint ep)
        {
            ObjectUpdatePacket packet = (ObjectUpdatePacket)p;
            foreach (var block in packet.ObjectData) {
                if (block.PCode == (byte)PCode.Avatar) {
                    string name = Utils.BytesToString(block.NameValue);
                    name = name.Replace("STRING RW SV ", "");
                    string[] tokens = name.Split(' ', '\n');
                    string firstName = tokens[1];
                    string lastName = tokens[3];

                    Invoke(new Action(() => {
                        Avatar avatar = new Avatar(firstName, lastName, block.ID, block.FullID);
                        avatarList.Items.Add(avatar);
                        avatarList.SelectedItem = avatar;
                        avatars[avatar.ID] = avatar;
                    }));
                }
            }
            return packet;
        }
コード例 #36
0
ファイル: Rendering.cs プロジェクト: robincornelius/radegast
        private void AddAvatarToScene(Avatar av)
        {
            lock (Avatars)
            {
                if (Avatars.ContainsKey(av.LocalID))
                {
                    // flag we got an update??
                    updateAVtes(Avatars[av.LocalID]);
                    Avatars[av.LocalID].glavatar.morph(av);
                }
                else
                {
                    GLAvatar ga = new GLAvatar();

                    //ga.morph(av);
                    RenderAvatar ra = new Rendering.RenderAvatar();
                    ra.avatar = av;
                    ra.glavatar = ga;
                    updateAVtes(ra);
                    Avatars.Add(av.LocalID, ra);
                    ra.glavatar.morph(av);
                    if (av.LocalID == Client.Self.LocalID)
                    {
                        myself = ra;
                    }
                }
            }
        }
コード例 #37
0
ファイル: AgentManager.cs プロジェクト: RavenB/gridsearch
        /// <summary>
        /// Update agents profile interests
        /// </summary>
        /// <param name="interests">selection of interests from <seealso cref="T:OpenMetaverse.Avatar.Interests"/> struct</param>
        public void UpdateInterests(Avatar.Interests interests)
        {
            AvatarInterestsUpdatePacket aiup = new AvatarInterestsUpdatePacket();
            aiup.AgentData.AgentID = id;
            aiup.AgentData.SessionID = sessionID;
            aiup.PropertiesData.LanguagesText = Utils.StringToBytes(interests.LanguagesText);
            aiup.PropertiesData.SkillsMask = interests.SkillsMask;
            aiup.PropertiesData.SkillsText = Utils.StringToBytes(interests.SkillsText);
            aiup.PropertiesData.WantToMask = interests.WantToMask;
            aiup.PropertiesData.WantToText = Utils.StringToBytes(interests.WantToText);

            Client.Network.SendPacket(aiup);
        }
コード例 #38
0
 private OMVSD.OSD GetHandler(RestHandler handler, Uri uri, String after)
 {
     OMVSD.OSDMap ret = new OMVSD.OSDMap();
     lock (m_avatars) {
         foreach (KeyValuePair <string, IEntityAvatar> kvp in m_avatars)
         {
             OMVSD.OSDMap  oneAV = new OMVSD.OSDMap();
             IEntityAvatar iav   = kvp.Value;
             try {
                 oneAV.Add("Name", new OMVSD.OSDString(iav.DisplayName));
                 oneAV.Add("Region", new OMVSD.OSDString(iav.RegionContext.Name.Name));
                 oneAV.Add("X", new OMVSD.OSDString(iav.RegionPosition.X.ToString("###0.###")));
                 oneAV.Add("Y", new OMVSD.OSDString(iav.RegionPosition.Y.ToString("###0.###")));
                 oneAV.Add("Z", new OMVSD.OSDString(iav.RegionPosition.Z.ToString("###0.###")));
                 float dist = 0f;
                 if (m_agentAV != null)
                 {
                     dist = OMV.Vector3.Distance(m_agentAV.RegionPosition, iav.RegionPosition);
                 }
                 oneAV.Add("Distance", new OMVSD.OSDString(dist.ToString("###0.###")));
                 oneAV.Add("Flags", new OMVSD.OSDString(iav.ActivityFlags));
                 if (iav is LLEntityAvatar)
                 {
                     OMV.Avatar av = ((LLEntityAvatar)iav).Avatar;
                     if (av != null)
                     {
                         OMVSD.OSDMap avTextures           = new OMVSD.OSDMap();
                         OMV.Primitive.TextureEntry texEnt = av.Textures;
                         if (texEnt != null)
                         {
                             OMV.Primitive.TextureEntryFace[] texFaces = texEnt.FaceTextures;
                             if (texFaces != null)
                             {
                                 if (texFaces[(int)OMV.AvatarTextureIndex.HeadBaked] != null)
                                 {
                                     avTextures.Add("head", new OMVSD.OSDString(texFaces[(int)OMV.AvatarTextureIndex.HeadBaked].TextureID.ToString()));
                                 }
                                 if (texFaces[(int)OMV.AvatarTextureIndex.UpperBaked] != null)
                                 {
                                     avTextures.Add("upper", new OMVSD.OSDString(texFaces[(int)OMV.AvatarTextureIndex.UpperBaked].TextureID.ToString()));
                                 }
                                 if (texFaces[(int)OMV.AvatarTextureIndex.LowerBaked] != null)
                                 {
                                     avTextures.Add("lower", new OMVSD.OSDString(texFaces[(int)OMV.AvatarTextureIndex.LowerBaked].TextureID.ToString()));
                                 }
                                 if (texFaces[(int)OMV.AvatarTextureIndex.EyesBaked] != null)
                                 {
                                     avTextures.Add("eyes", new OMVSD.OSDString(texFaces[(int)OMV.AvatarTextureIndex.EyesBaked].TextureID.ToString()));
                                 }
                                 if (texFaces[(int)OMV.AvatarTextureIndex.HairBaked] != null)
                                 {
                                     avTextures.Add("hair", new OMVSD.OSDString(texFaces[(int)OMV.AvatarTextureIndex.HairBaked].TextureID.ToString()));
                                 }
                                 if (texFaces[(int)OMV.AvatarTextureIndex.SkirtBaked] != null)
                                 {
                                     avTextures.Add("skirt", new OMVSD.OSDString(texFaces[(int)OMV.AvatarTextureIndex.SkirtBaked].TextureID.ToString()));
                                 }
                                 oneAV.Add("LLtextures", avTextures);
                             }
                         }
                     }
                 }
             }
             catch (Exception e) {
                 LogManager.Log.Log(LogLevel.DBADERROR, "AvatarTracker.GetHandler: exception building response: {0}", e);
             }
             ret.Add(kvp.Value.Name.Name.Replace('/', '-'), oneAV);
         }
     }
     return(ret);
 }