From 79eecd3d25ccc701d5b2aba77f034c03a20b6556 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Sat, 24 May 2008 22:10:14 +0000
Subject: * Refactor: Renaming various *Entity*() methods to *Object*() methods
on the basis that they all take SOG parameters to improve code readability
for now
---
.../World/TreePopulator/TreePopulatorModule.cs | 2 +-
OpenSim/Region/Environment/Scenes/InnerScene.cs | 17 +++++++++----
.../Region/Environment/Scenes/Scene.Inventory.cs | 6 +++--
OpenSim/Region/Environment/Scenes/Scene.cs | 28 +++++++++++++++-------
.../Region/Environment/Scenes/SceneObjectGroup.cs | 2 +-
.../Region/Environment/Scenes/SceneXmlLoader.cs | 5 ++--
.../Region/Examples/SimpleModule/ComplexObject.cs | 2 +-
.../Region/Examples/SimpleModule/RegionModule.cs | 6 ++---
8 files changed, 46 insertions(+), 22 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs
index a62b78a..ae70436 100644
--- a/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs
@@ -179,7 +179,7 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator
if (Util.RandomClass.NextDouble() < killLikelyhood)
{
- m_scene.RemoveEntity(selectedTree.ParentGroup);
+ m_scene.RemoveObject(selectedTree.ParentGroup);
m_trees.Remove(selectedTree.ParentGroup.UUID);
m_scene.ForEachClient(delegate(IClientAPI controller)
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 4615e7a..4088746 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -182,7 +182,11 @@ namespace OpenSim.Region.Environment.Scenes
#region Entity Methods
- public void AddEntityFromStorage(SceneObjectGroup sceneObject)
+ ///
+ /// Add an object into the scene that has come from storage
+ ///
+ ///
+ public void AddObjectFromStorage(SceneObjectGroup sceneObject)
{
sceneObject.RegionHandle = m_regInfo.RegionHandle;
sceneObject.SetScene(m_parentScene);
@@ -192,10 +196,15 @@ namespace OpenSim.Region.Environment.Scenes
}
sceneObject.UpdateParentIDs();
- AddEntity(sceneObject);
+
+ AddObject(sceneObject);
}
- public void AddEntity(SceneObjectGroup sceneObject)
+ ///
+ /// Add an object to the scene.
+ ///
+ ///
+ public void AddObject(SceneObjectGroup sceneObject)
{
if (!Entities.ContainsKey(sceneObject.UUID))
{
@@ -290,7 +299,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (m_parentScene.ExternalChecks.ExternalChecksCanDeleteObject(((SceneObjectGroup)obj).UUID, avatar_deleter))
{
- m_parentScene.RemoveEntity((SceneObjectGroup)obj);
+ m_parentScene.RemoveObject((SceneObjectGroup)obj);
m_numPrim--;
}
return;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 409ee1e..81ab733 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -1501,7 +1501,8 @@ namespace OpenSim.Region.Environment.Scenes
}
group.ResetIDs();
- AddEntity(group);
+
+ AddObject(group);
// if attachment we set it's asset id so object updates can reflect that
// if not, we set it's position in world.
@@ -1612,7 +1613,8 @@ namespace OpenSim.Region.Environment.Scenes
return null;
}
group.ResetIDs();
- AddEntity(group);
+
+ AddObject(group);
// Set the startup parameter for on_rez event and llGetStartParameter() function
group.StartParameter = param;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 7c198bf..5912c51 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1163,7 +1163,7 @@ namespace OpenSim.Region.Environment.Scenes
List PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID);
foreach (SceneObjectGroup group in PrimsFromDB)
{
- AddEntityFromStorage(group);
+ AddObjectFromStorage(group);
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted;
rootPart.TrimPermissions();
@@ -1290,7 +1290,7 @@ namespace OpenSim.Region.Environment.Scenes
{
SceneObjectGroup sceneOb =
new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape);
- AddEntity(sceneOb);
+ AddObject(sceneOb);
SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
// if grass or tree, make phantom
//rootPart.TrimPermissions();
@@ -1324,17 +1324,29 @@ namespace OpenSim.Region.Environment.Scenes
m_innerScene.RemovePrim(localID, avatar_deleter);
}
- public void AddEntityFromStorage(SceneObjectGroup sceneObject)
+ ///
+ /// Add an object into the scene that has come from storage
+ ///
+ ///
+ public void AddObjectFromStorage(SceneObjectGroup sceneObject)
{
- m_innerScene.AddEntityFromStorage(sceneObject);
+ m_innerScene.AddObjectFromStorage(sceneObject);
}
- public void AddEntity(SceneObjectGroup sceneObject)
+ ///
+ /// Add an object to the scene
+ ///
+ ///
+ public void AddObject(SceneObjectGroup sceneObject)
{
- m_innerScene.AddEntity(sceneObject);
+ m_innerScene.AddObject(sceneObject);
}
- public void RemoveEntity(SceneObjectGroup sceneObject)
+ ///
+ /// Remove an object from the scene
+ ///
+ ///
+ public void RemoveObject(SceneObjectGroup sceneObject)
{
if (Entities.ContainsKey(sceneObject.UUID))
{
@@ -3152,7 +3164,7 @@ namespace OpenSim.Region.Environment.Scenes
lock (Entities)
{
- RemoveEntity(group);
+ RemoveObject(group);
}
group.DeleteParts();
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index a99426a..935253f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1841,7 +1841,7 @@ namespace OpenSim.Region.Environment.Scenes
SceneObjectGroup objectGroup = new SceneObjectGroup(m_scene, m_regionHandle, linkPart);
- m_scene.AddEntity(objectGroup);
+ m_scene.AddObject(objectGroup);
ScheduleGroupForFullUpdate();
}
diff --git a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
index 7d048a3..13483bb 100644
--- a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs
@@ -71,7 +71,8 @@ namespace OpenSim.Region.Environment.Scenes
}
//if we want this to be a import method then we need new uuids for the object to avoid any clashes
//obj.RegenerateFullIDs();
- m_innerScene.AddEntity(obj);
+
+ m_innerScene.AddObject(obj);
SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
// Apply loadOffsets for load/import and move combinations
@@ -183,7 +184,7 @@ namespace OpenSim.Region.Environment.Scenes
SceneObjectGroup obj = new SceneObjectGroup(xmlData);
LLVector3 receivedVelocity = obj.RootPart.Velocity;
//System.Console.WriteLine(obj.RootPart.Velocity.ToString());
- m_innerScene.AddEntityFromStorage(obj);
+ m_innerScene.AddObjectFromStorage(obj);
SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
bool UsePhysics = (((rootPart.GetEffectiveObjectFlags() & (uint) LLObject.ObjectFlags.Physics) > 0) &&
diff --git a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs
index 8efbf27..5300750 100644
--- a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs
+++ b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs
@@ -126,7 +126,7 @@ namespace OpenSim.Region.Examples.SimpleModule
if (m_parts.Count == 1)
{
m_parts.Remove(m_rootPart.UUID);
- m_scene.RemoveEntity(this);
+ m_scene.RemoveObject(this);
remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalId);
remoteClient.AddMoney(50);
remoteClient.SendChatMessage("KABLAM!!!", 1, AbsolutePosition, "Groupie Groupie", LLUUID.Zero, (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully);
diff --git a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs
index 81abb3f..4129d61 100644
--- a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs
+++ b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs
@@ -76,7 +76,7 @@ namespace OpenSim.Region.Examples.SimpleModule
}
FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos);
- m_scene.AddEntity(fileObject);
+ m_scene.AddObject(fileObject);
fileObject.ScheduleGroupForFullUpdate();
}
}
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Examples.SimpleModule
ComplexObject complexObject =
new ComplexObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(),
pos + posOffset);
- m_scene.AddEntity(complexObject);
+ m_scene.AddObject(complexObject);
}
}
@@ -116,7 +116,7 @@ namespace OpenSim.Region.Examples.SimpleModule
SceneObjectGroup sceneObject =
new CpuCounterObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(),
pos + new LLVector3(1f, 1f, 1f));
- m_scene.AddEntity(sceneObject);
+ m_scene.AddObject(sceneObject);
}
public void Close()
--
cgit v1.1