From 7d8bb33c5b2420d4e744269f67a25dd2b9746a35 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 7 Apr 2012 00:33:02 +0100
Subject: Store FromItemID for attachments once on SOG instead of on every SOP
and only ever using the root part entry.
This eliminates some pointless memory use.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 2 +-
.../Region/Framework/Scenes/SceneObjectGroup.cs | 28 ++++++++++------------
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 --
3 files changed, 13 insertions(+), 19 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d8cac66..e488fe1 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2566,7 +2566,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroup grp = sceneObject;
m_log.DebugFormat(
- "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.GetFromItemID(), grp.UUID);
+ "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.FromItemID, grp.UUID);
m_log.DebugFormat(
"[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 87fdc41..3586e95 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -571,7 +571,9 @@ namespace OpenSim.Region.Framework.Scenes
set { m_LoopSoundSlavePrims = value; }
}
- // The UUID for the Region this Object is in.
+ ///
+ /// The UUID for the region this object is in.
+ ///
public UUID RegionUUID
{
get
@@ -584,6 +586,11 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ ///
+ /// The item ID that this object was rezzed from, if applicable.
+ ///
+ public UUID FromItemID { get; set; }
+
#endregion
// ~SceneObjectGroup()
@@ -646,18 +653,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- public void SetFromItemID(UUID AssetId)
- {
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- parts[i].FromItemID = AssetId;
- }
-
- public UUID GetFromItemID()
- {
- return m_rootPart.FromItemID;
- }
-
///
/// Hooks this object up to the backup event so that it is persisted to the database when the update thread executes.
///
@@ -2687,6 +2682,7 @@ namespace OpenSim.Region.Framework.Scenes
{
m_rootPart.AttachedPos = pos;
}
+
if (RootPart.GetStatusSandbox())
{
if (Util.GetDistanceTo(RootPart.StatusSandboxPos, pos) > 10)
@@ -2697,8 +2693,8 @@ namespace OpenSim.Region.Framework.Scenes
ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
}
}
- AbsolutePosition = pos;
+ AbsolutePosition = pos;
HasGroupChanged = true;
}
@@ -3270,7 +3266,7 @@ namespace OpenSim.Region.Framework.Scenes
public virtual string ExtraToXmlString()
{
- return "" + GetFromItemID().ToString() + "";
+ return "" + FromItemID.ToString() + "";
}
public virtual void ExtraFromXmlString(string xmlstr)
@@ -3282,7 +3278,7 @@ namespace OpenSim.Region.Framework.Scenes
UUID uuid = UUID.Zero;
UUID.TryParse(id, out uuid);
- SetFromItemID(uuid);
+ FromItemID = uuid;
}
#endregion
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 2fcce1c..fffaa06 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -181,8 +181,6 @@ namespace OpenSim.Region.Framework.Scenes
public uint TimeStampLastActivity; // Will be used for AutoReturn
public uint TimeStampTerse;
-
- public UUID FromItemID;
public UUID FromFolderID;
--
cgit v1.1