aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-12-09 23:07:53 +0000
committerJustin Clark-Casey (justincc)2011-12-09 23:07:53 +0000
commitaf3cd00048fb6476eb5140bcfccda926627363f2 (patch)
treea795ef16e7d6db97bd2cddf8737027c1e95ff853 /OpenSim
parentremove some unused fields in ScenePresence (diff)
downloadopensim-SC-af3cd00048fb6476eb5140bcfccda926627363f2.zip
opensim-SC-af3cd00048fb6476eb5140bcfccda926627363f2.tar.gz
opensim-SC-af3cd00048fb6476eb5140bcfccda926627363f2.tar.bz2
opensim-SC-af3cd00048fb6476eb5140bcfccda926627363f2.tar.xz
Get rid of IScene.PresenceChildStatus() which always had to execute a lookup in favour of IClientAPI.ISceneAgent.IsChildAgent instead.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/IScene.cs13
-rw-r--r--OpenSim/Framework/ISceneAgent.cs7
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs15
-rw-r--r--OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs6
7 files changed, 16 insertions, 57 deletions
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs
index e0e023d..b2604f4 100644
--- a/OpenSim/Framework/IScene.cs
+++ b/OpenSim/Framework/IScene.cs
@@ -89,19 +89,6 @@ namespace OpenSim.Framework
89 89
90 string GetSimulatorVersion(); 90 string GetSimulatorVersion();
91 91
92 /// <summary>
93 /// Is the agent denoted by the given agentID a child presence in this scene?
94 /// </summary>
95 /// <remarks>
96 /// Used by ClientView when a 'kick everyone' or 'estate message' occurs
97 /// </remarks>
98 /// <param name="avatarID">AvatarID to lookup</param>
99 /// <returns>true if the presence is a child agent, false if the presence is a root exception</returns>
100 /// <exception cref="System.NullReferenceException">
101 /// Thrown if the agent does not exist.
102 /// </exception>
103 bool PresenceChildStatus(UUID agentId);
104
105 bool TryGetScenePresence(UUID agentID, out object scenePresence); 92 bool TryGetScenePresence(UUID agentID, out object scenePresence);
106 93
107 /// <summary> 94 /// <summary>
diff --git a/OpenSim/Framework/ISceneAgent.cs b/OpenSim/Framework/ISceneAgent.cs
index 69e91ed..824172d 100644
--- a/OpenSim/Framework/ISceneAgent.cs
+++ b/OpenSim/Framework/ISceneAgent.cs
@@ -48,6 +48,13 @@ namespace OpenSim.Framework
48 PresenceType PresenceType { get; } 48 PresenceType PresenceType { get; }
49 49
50 /// <summary> 50 /// <summary>
51 /// If true, then the agent has no avatar in the scene.
52 /// The agent exists to relay data from a region that neighbours the current position of the user's avatar.
53 /// Occasionally data is relayed, such as which a user clicks an item in a neighbouring region.
54 /// </summary>
55 bool IsChildAgent { get; }
56
57 /// <summary>
51 /// Avatar appearance data. 58 /// Avatar appearance data.
52 /// </summary> 59 /// </summary>
53 /// <remarks> 60 /// <remarks>
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index f246637..1d4be8a 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -525,7 +525,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
525 525
526 public void Kick(string message) 526 public void Kick(string message)
527 { 527 {
528 if (!ChildAgentStatus()) 528 if (!SceneAgent.IsChildAgent)
529 { 529 {
530 KickUserPacket kupack = (KickUserPacket)PacketPool.Instance.GetPacket(PacketType.KickUser); 530 KickUserPacket kupack = (KickUserPacket)PacketPool.Instance.GetPacket(PacketType.KickUser);
531 kupack.UserInfo.AgentID = AgentId; 531 kupack.UserInfo.AgentID = AgentId;
@@ -2448,7 +2448,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2448 /// <param name="Message"></param> 2448 /// <param name="Message"></param>
2449 public void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message) 2449 public void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message)
2450 { 2450 {
2451 if (!ChildAgentStatus()) 2451 if (!SceneAgent.IsChildAgent)
2452 SendInstantMessage(new GridInstantMessage(null, FromAvatarID, FromAvatarName, AgentId, 1, Message, false, new Vector3())); 2452 SendInstantMessage(new GridInstantMessage(null, FromAvatarID, FromAvatarName, AgentId, 1, Message, false, new Vector3()));
2453 2453
2454 //SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)21,(uint) Util.UnixTimeSinceEpoch()); 2454 //SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)21,(uint) Util.UnixTimeSinceEpoch());
@@ -5054,14 +5054,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5054 return 0; 5054 return 0;
5055 } 5055 }
5056 5056
5057 /// <summary>
5058 /// This is a utility method used by single states to not duplicate kicks and blue card of death messages.
5059 /// </summary>
5060 public bool ChildAgentStatus()
5061 {
5062 return m_scene.PresenceChildStatus(AgentId);
5063 }
5064
5065 #endregion 5057 #endregion
5066 5058
5067 /// <summary> 5059 /// <summary>
@@ -11625,7 +11617,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11625 if (logPacket) 11617 if (logPacket)
11626 m_log.DebugFormat( 11618 m_log.DebugFormat(
11627 "[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}", 11619 "[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}",
11628 Name, ChildAgentStatus() ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type); 11620 Name, SceneAgent.IsChildAgent ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type);
11629 } 11621 }
11630 11622
11631 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method); 11623 m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting, method);
@@ -11682,7 +11674,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11682 if (logPacket) 11674 if (logPacket)
11683 m_log.DebugFormat( 11675 m_log.DebugFormat(
11684 "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}", 11676 "[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}",
11685 Name, ChildAgentStatus() ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type); 11677 Name, SceneAgent.IsChildAgent ? "child" : "root ", m_scene.RegionInfo.RegionName, packet.Type);
11686 } 11678 }
11687 11679
11688 if (!ProcessPacketMethod(packet)) 11680 if (!ProcessPacketMethod(packet))
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 11505cc..9fdf395 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4193,17 +4193,6 @@ namespace OpenSim.Region.Framework.Scenes
4193 } 4193 }
4194 4194
4195 /// <summary> 4195 /// <summary>
4196 /// Returns true if scene presence is a child (no avatar in this scene)
4197 /// </summary>
4198 /// <param name="avatarID"></param>
4199 /// <returns></returns>
4200 public override bool PresenceChildStatus(UUID avatarID)
4201 {
4202 ScenePresence sp;
4203 return TryGetScenePresence(avatarID, out sp) && sp.IsChildAgent;
4204 }
4205
4206 /// <summary>
4207 /// Performs action on all avatars in the scene (root scene presences) 4196 /// Performs action on all avatars in the scene (root scene presences)
4208 /// Avatars may be an NPC or a 'real' client. 4197 /// Avatars may be an NPC or a 'real' client.
4209 /// </summary> 4198 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index da15491..712e094 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -211,11 +211,6 @@ namespace OpenSim.Region.Framework.Scenes
211 } 211 }
212 212
213 #region admin stuff 213 #region admin stuff
214
215 public virtual bool PresenceChildStatus(UUID avatarID)
216 {
217 return false;
218 }
219 214
220 public abstract void OtherRegionUp(GridRegion otherRegion); 215 public abstract void OtherRegionUp(GridRegion otherRegion);
221 216
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index cebf51b..fa731a7 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -612,19 +612,7 @@ namespace OpenSim.Region.Framework.Scenes
612 } 612 }
613 } 613 }
614 614
615 /// <summary> 615 public bool IsChildAgent { get; set; }
616 /// If this is true, agent doesn't have a representation in this scene.
617 /// this is an agent 'looking into' this scene from a nearby scene(region)
618 ///
619 /// if False, this agent has a representation in this scene
620 /// </summary>
621 private bool m_isChildAgent = true;
622
623 public bool IsChildAgent
624 {
625 get { return m_isChildAgent; }
626 set { m_isChildAgent = value; }
627 }
628 616
629 public uint ParentID 617 public uint ParentID
630 { 618 {
@@ -741,6 +729,7 @@ namespace OpenSim.Region.Framework.Scenes
741 { 729 {
742 AttachmentsSyncLock = new Object(); 730 AttachmentsSyncLock = new Object();
743 731
732 IsChildAgent = true;
744 m_sendCourseLocationsMethod = SendCoarseLocationsDefault; 733 m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
745 Animator = new ScenePresenceAnimator(this); 734 Animator = new ScenePresenceAnimator(this);
746 PresenceType = type; 735 PresenceType = type;
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
index 8f8124e..c754019 100644
--- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
@@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
219 { 219 {
220 if (client is LLClientView) 220 if (client is LLClientView)
221 { 221 {
222 bool isChild = scene.PresenceChildStatus(client.AgentId); 222 bool isChild = client.SceneAgent.IsChildAgent;
223 if (isChild && !showChildren) 223 if (isChild && !showChildren)
224 return; 224 return;
225 225
@@ -308,7 +308,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
308 { 308 {
309 if (client is IStatsCollector) 309 if (client is IStatsCollector)
310 { 310 {
311 bool isChild = scene.PresenceChildStatus(client.AgentId); 311 bool isChild = client.SceneAgent.IsChildAgent;
312 if (isChild && !showChildren) 312 if (isChild && !showChildren)
313 return; 313 return;
314 314
@@ -404,7 +404,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
404 firstClient = false; 404 firstClient = false;
405 } 405 }
406 406
407 bool isChild = scene.PresenceChildStatus(client.AgentId); 407 bool isChild = client.SceneAgent.IsChildAgent;
408 if (isChild && !showChildren) 408 if (isChild && !showChildren)
409 return; 409 return;
410 410