Get rid of IScene.PresenceChildStatus() which always had to execute a lookup in favour of IClientAPI.ISceneAgent.IsChildAgent instead.
							parent
							
								
									fc27806e90
								
							
						
					
					
						commit
						af3cd00048
					
				| 
						 | 
				
			
			@ -89,19 +89,6 @@ namespace OpenSim.Framework
 | 
			
		|||
 | 
			
		||||
        string GetSimulatorVersion();
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// Is the agent denoted by the given agentID a child presence in this scene?
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <remarks>
 | 
			
		||||
        /// Used by ClientView when a 'kick everyone' or 'estate message' occurs
 | 
			
		||||
        /// </remarks>
 | 
			
		||||
        /// <param name="avatarID">AvatarID to lookup</param>
 | 
			
		||||
        /// <returns>true if the presence is a child agent, false if the presence is a root exception</returns>
 | 
			
		||||
        /// <exception cref="System.NullReferenceException">
 | 
			
		||||
        /// Thrown if the agent does not exist.
 | 
			
		||||
        /// </exception>
 | 
			
		||||
        bool PresenceChildStatus(UUID agentId);
 | 
			
		||||
 | 
			
		||||
        bool TryGetScenePresence(UUID agentID, out object scenePresence);
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -47,6 +47,13 @@ namespace OpenSim.Framework
 | 
			
		|||
        /// </summary>
 | 
			
		||||
        PresenceType PresenceType { get; }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// If true, then the agent has no avatar in the scene.
 | 
			
		||||
        /// The agent exists to relay data from a region that neighbours the current position of the user's avatar.
 | 
			
		||||
        /// Occasionally data is relayed, such as which a user clicks an item in a neighbouring region.
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        bool IsChildAgent { get; }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// Avatar appearance data.
 | 
			
		||||
        /// </summary>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -525,7 +525,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 | 
			
		|||
 | 
			
		||||
        public void Kick(string message)
 | 
			
		||||
        {
 | 
			
		||||
            if (!ChildAgentStatus())
 | 
			
		||||
            if (!SceneAgent.IsChildAgent)
 | 
			
		||||
            {
 | 
			
		||||
                KickUserPacket kupack = (KickUserPacket)PacketPool.Instance.GetPacket(PacketType.KickUser);
 | 
			
		||||
                kupack.UserInfo.AgentID = AgentId;
 | 
			
		||||
| 
						 | 
				
			
			@ -2448,7 +2448,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 | 
			
		|||
        /// <param name="Message"></param>
 | 
			
		||||
        public void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message)
 | 
			
		||||
        {
 | 
			
		||||
            if (!ChildAgentStatus())
 | 
			
		||||
            if (!SceneAgent.IsChildAgent)
 | 
			
		||||
                SendInstantMessage(new GridInstantMessage(null, FromAvatarID, FromAvatarName, AgentId, 1, Message, false, new Vector3()));
 | 
			
		||||
 | 
			
		||||
            //SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)21,(uint) Util.UnixTimeSinceEpoch());
 | 
			
		||||
| 
						 | 
				
			
			@ -5054,14 +5054,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 | 
			
		|||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// This is a utility method used by single states to not duplicate kicks and blue card of death messages.
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public bool ChildAgentStatus()
 | 
			
		||||
        {
 | 
			
		||||
            return m_scene.PresenceChildStatus(AgentId);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        #endregion
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
| 
						 | 
				
			
			@ -11625,7 +11617,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 | 
			
		|||
                if (logPacket)
 | 
			
		||||
                    m_log.DebugFormat(
 | 
			
		||||
                        "[CLIENT]: PACKET OUT to   {0} ({1}) in {2} - {3}",
 | 
			
		||||
                        Name, ChildAgentStatus() ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type);
 | 
			
		||||
                        Name, SceneAgent.IsChildAgent ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type);
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
            m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method);
 | 
			
		||||
| 
						 | 
				
			
			@ -11682,7 +11674,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
 | 
			
		|||
                if (logPacket)
 | 
			
		||||
                    m_log.DebugFormat(
 | 
			
		||||
                        "[CLIENT]: PACKET IN  from {0} ({1}) in {2} - {3}",
 | 
			
		||||
                        Name, ChildAgentStatus() ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type);
 | 
			
		||||
                        Name, SceneAgent.IsChildAgent ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (!ProcessPacketMethod(packet))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4192,17 +4192,6 @@ namespace OpenSim.Region.Framework.Scenes
 | 
			
		|||
            return m_sceneGraph.GetScenePresence(localID);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// Returns true if scene presence is a child (no avatar in this scene)
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="avatarID"></param>
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
        public override bool PresenceChildStatus(UUID avatarID)
 | 
			
		||||
        {
 | 
			
		||||
            ScenePresence sp;
 | 
			
		||||
            return TryGetScenePresence(avatarID, out sp) && sp.IsChildAgent;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// Performs action on all avatars in the scene (root scene presences)
 | 
			
		||||
        /// Avatars may be an NPC or a 'real' client.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -211,11 +211,6 @@ namespace OpenSim.Region.Framework.Scenes
 | 
			
		|||
        }
 | 
			
		||||
 | 
			
		||||
        #region admin stuff
 | 
			
		||||
 | 
			
		||||
        public virtual bool PresenceChildStatus(UUID avatarID)
 | 
			
		||||
        {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        public abstract void OtherRegionUp(GridRegion otherRegion);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -612,19 +612,7 @@ namespace OpenSim.Region.Framework.Scenes
 | 
			
		|||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// If this is true, agent doesn't have a representation in this scene.
 | 
			
		||||
        ///    this is an agent 'looking into' this scene from a nearby scene(region)
 | 
			
		||||
        ///
 | 
			
		||||
        /// if False, this agent has a representation in this scene
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        private bool m_isChildAgent = true;
 | 
			
		||||
 | 
			
		||||
        public bool IsChildAgent
 | 
			
		||||
        {
 | 
			
		||||
            get { return m_isChildAgent; }
 | 
			
		||||
            set { m_isChildAgent = value; }
 | 
			
		||||
        }
 | 
			
		||||
        public bool IsChildAgent { get; set; }
 | 
			
		||||
 | 
			
		||||
        public uint ParentID
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -741,6 +729,7 @@ namespace OpenSim.Region.Framework.Scenes
 | 
			
		|||
        {
 | 
			
		||||
            AttachmentsSyncLock = new Object();
 | 
			
		||||
 | 
			
		||||
            IsChildAgent = true;
 | 
			
		||||
            m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
 | 
			
		||||
            Animator = new ScenePresenceAnimator(this);
 | 
			
		||||
            PresenceType = type;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
 | 
			
		|||
                        {
 | 
			
		||||
                            if (client is LLClientView)
 | 
			
		||||
                            {
 | 
			
		||||
                                bool isChild = scene.PresenceChildStatus(client.AgentId);
 | 
			
		||||
                                bool isChild = client.SceneAgent.IsChildAgent;
 | 
			
		||||
                                if (isChild && !showChildren)
 | 
			
		||||
                                    return;
 | 
			
		||||
                        
 | 
			
		||||
| 
						 | 
				
			
			@ -308,7 +308,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
 | 
			
		|||
                        {
 | 
			
		||||
                            if (client is IStatsCollector)
 | 
			
		||||
                            {
 | 
			
		||||
                                bool isChild = scene.PresenceChildStatus(client.AgentId);
 | 
			
		||||
                                bool isChild = client.SceneAgent.IsChildAgent;
 | 
			
		||||
                                if (isChild && !showChildren)
 | 
			
		||||
                                    return;
 | 
			
		||||
                        
 | 
			
		||||
| 
						 | 
				
			
			@ -404,7 +404,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
 | 
			
		|||
                                    firstClient = false;
 | 
			
		||||
                                }
 | 
			
		||||
 | 
			
		||||
                                bool isChild = scene.PresenceChildStatus(client.AgentId);
 | 
			
		||||
                                bool isChild = client.SceneAgent.IsChildAgent;
 | 
			
		||||
                                if (isChild && !showChildren)
 | 
			
		||||
                                    return;
 | 
			
		||||
                        
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue