aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
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/Region
parentremove some unused fields in ScenePresence (diff)
downloadopensim-SC_OLD-af3cd00048fb6476eb5140bcfccda926627363f2.zip
opensim-SC_OLD-af3cd00048fb6476eb5140bcfccda926627363f2.tar.gz
opensim-SC_OLD-af3cd00048fb6476eb5140bcfccda926627363f2.tar.bz2
opensim-SC_OLD-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 'OpenSim/Region')
-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
5 files changed, 9 insertions, 44 deletions
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