Пример #1
0
        /// <summary>
        /// Tell our client about other client's avatar (includes appearance and full object update)
        /// </summary>
        /// <param name="m_presence"></param>
        public void SendPresenceToUs(ScenePresence avatar)
        {
            if (m_presence.IsBot)
            {
                return;
            }
            if (avatar.IsChildAgent)
            {
                return;
            }
            // uint inRegion = (uint)avatar.AgentInRegion;
            if (!avatar.IsFullyInRegion)
            {
                // m_log.WarnFormat("[SendPresenceToUs]: AgentInRegion={0:x2}",inRegion);
                return; // don't send to them yet, they aren't ready
            }
            if (avatar.IsDeleted)
            {
                return; // don't send them, they're on their way outta here
            }
            // Witnessed an exception internal to the .Add method with the list resizing. The avatar.UUID was
            // already in the list inside the .Add call, so it should be safe to ignore here (already added).
            try
            {
                if (!m_presencesInView.Contains(avatar.UUID))
                {
                    m_presencesInView.Add(avatar.UUID);
                }
            }
            catch (Exception)
            {
                m_log.InfoFormat("[SCENEVIEW]: Exception adding presence, probably race with it already added. Ignoring.");
            }

            avatar.SceneView.SendFullUpdateToOtherClient(m_presence);
            avatar.SendAppearanceToOtherAgent(m_presence);
            avatar.SendAnimPackToClient(m_presence.ControllingClient);

            avatar.SendFullUpdateForAttachments(m_presence);
        }