aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-05-24 22:10:14 +0000
committerJustin Clarke Casey2008-05-24 22:10:14 +0000
commit79eecd3d25ccc701d5b2aba77f034c03a20b6556 (patch)
tree188b83286b22fa7f655149a9494a834985fe0e8e /OpenSim/Region/Environment
parent* Refactor: Push some dictionary initialization down from Scene into InnerScene (diff)
downloadopensim-SC-79eecd3d25ccc701d5b2aba77f034c03a20b6556.zip
opensim-SC-79eecd3d25ccc701d5b2aba77f034c03a20b6556.tar.gz
opensim-SC-79eecd3d25ccc701d5b2aba77f034c03a20b6556.tar.bz2
opensim-SC-79eecd3d25ccc701d5b2aba77f034c03a20b6556.tar.xz
* Refactor: Renaming various *Entity*() methods to *Object*() methods on the basis that they all take SOG parameters to improve code readability for now
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/World/TreePopulator/TreePopulatorModule.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs17
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs6
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs28
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs5
6 files changed, 42 insertions, 18 deletions
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
179 179
180 if (Util.RandomClass.NextDouble() < killLikelyhood) 180 if (Util.RandomClass.NextDouble() < killLikelyhood)
181 { 181 {
182 m_scene.RemoveEntity(selectedTree.ParentGroup); 182 m_scene.RemoveObject(selectedTree.ParentGroup);
183 m_trees.Remove(selectedTree.ParentGroup.UUID); 183 m_trees.Remove(selectedTree.ParentGroup.UUID);
184 184
185 m_scene.ForEachClient(delegate(IClientAPI controller) 185 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
182 182
183 #region Entity Methods 183 #region Entity Methods
184 184
185 public void AddEntityFromStorage(SceneObjectGroup sceneObject) 185 /// <summary>
186 /// Add an object into the scene that has come from storage
187 /// </summary>
188 /// <param name="sceneObject"></param>
189 public void AddObjectFromStorage(SceneObjectGroup sceneObject)
186 { 190 {
187 sceneObject.RegionHandle = m_regInfo.RegionHandle; 191 sceneObject.RegionHandle = m_regInfo.RegionHandle;
188 sceneObject.SetScene(m_parentScene); 192 sceneObject.SetScene(m_parentScene);
@@ -192,10 +196,15 @@ namespace OpenSim.Region.Environment.Scenes
192 196
193 } 197 }
194 sceneObject.UpdateParentIDs(); 198 sceneObject.UpdateParentIDs();
195 AddEntity(sceneObject); 199
200 AddObject(sceneObject);
196 } 201 }
197 202
198 public void AddEntity(SceneObjectGroup sceneObject) 203 /// <summary>
204 /// Add an object to the scene.
205 /// </summary>
206 /// <param name="sceneObject"></param>
207 public void AddObject(SceneObjectGroup sceneObject)
199 { 208 {
200 if (!Entities.ContainsKey(sceneObject.UUID)) 209 if (!Entities.ContainsKey(sceneObject.UUID))
201 { 210 {
@@ -290,7 +299,7 @@ namespace OpenSim.Region.Environment.Scenes
290 { 299 {
291 if (m_parentScene.ExternalChecks.ExternalChecksCanDeleteObject(((SceneObjectGroup)obj).UUID, avatar_deleter)) 300 if (m_parentScene.ExternalChecks.ExternalChecksCanDeleteObject(((SceneObjectGroup)obj).UUID, avatar_deleter))
292 { 301 {
293 m_parentScene.RemoveEntity((SceneObjectGroup)obj); 302 m_parentScene.RemoveObject((SceneObjectGroup)obj);
294 m_numPrim--; 303 m_numPrim--;
295 } 304 }
296 return; 305 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
1501 } 1501 }
1502 1502
1503 group.ResetIDs(); 1503 group.ResetIDs();
1504 AddEntity(group); 1504
1505 AddObject(group);
1505 1506
1506 // if attachment we set it's asset id so object updates can reflect that 1507 // if attachment we set it's asset id so object updates can reflect that
1507 // if not, we set it's position in world. 1508 // if not, we set it's position in world.
@@ -1612,7 +1613,8 @@ namespace OpenSim.Region.Environment.Scenes
1612 return null; 1613 return null;
1613 } 1614 }
1614 group.ResetIDs(); 1615 group.ResetIDs();
1615 AddEntity(group); 1616
1617 AddObject(group);
1616 1618
1617 // Set the startup parameter for on_rez event and llGetStartParameter() function 1619 // Set the startup parameter for on_rez event and llGetStartParameter() function
1618 group.StartParameter = param; 1620 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
1163 List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); 1163 List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID);
1164 foreach (SceneObjectGroup group in PrimsFromDB) 1164 foreach (SceneObjectGroup group in PrimsFromDB)
1165 { 1165 {
1166 AddEntityFromStorage(group); 1166 AddObjectFromStorage(group);
1167 SceneObjectPart rootPart = group.GetChildPart(group.UUID); 1167 SceneObjectPart rootPart = group.GetChildPart(group.UUID);
1168 rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted; 1168 rootPart.ObjectFlags &= ~(uint)LLObject.ObjectFlags.Scripted;
1169 rootPart.TrimPermissions(); 1169 rootPart.TrimPermissions();
@@ -1290,7 +1290,7 @@ namespace OpenSim.Region.Environment.Scenes
1290 { 1290 {
1291 SceneObjectGroup sceneOb = 1291 SceneObjectGroup sceneOb =
1292 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape); 1292 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape);
1293 AddEntity(sceneOb); 1293 AddObject(sceneOb);
1294 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); 1294 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
1295 // if grass or tree, make phantom 1295 // if grass or tree, make phantom
1296 //rootPart.TrimPermissions(); 1296 //rootPart.TrimPermissions();
@@ -1324,17 +1324,29 @@ namespace OpenSim.Region.Environment.Scenes
1324 m_innerScene.RemovePrim(localID, avatar_deleter); 1324 m_innerScene.RemovePrim(localID, avatar_deleter);
1325 } 1325 }
1326 1326
1327 public void AddEntityFromStorage(SceneObjectGroup sceneObject) 1327 /// <summary>
1328 /// Add an object into the scene that has come from storage
1329 /// </summary>
1330 /// <param name="sceneObject"></param>
1331 public void AddObjectFromStorage(SceneObjectGroup sceneObject)
1328 { 1332 {
1329 m_innerScene.AddEntityFromStorage(sceneObject); 1333 m_innerScene.AddObjectFromStorage(sceneObject);
1330 } 1334 }
1331 1335
1332 public void AddEntity(SceneObjectGroup sceneObject) 1336 /// <summary>
1337 /// Add an object to the scene
1338 /// </summary>
1339 /// <param name="sceneObject"></param>
1340 public void AddObject(SceneObjectGroup sceneObject)
1333 { 1341 {
1334 m_innerScene.AddEntity(sceneObject); 1342 m_innerScene.AddObject(sceneObject);
1335 } 1343 }
1336 1344
1337 public void RemoveEntity(SceneObjectGroup sceneObject) 1345 /// <summary>
1346 /// Remove an object from the scene
1347 /// </summary>
1348 /// <param name="sceneObject"></param>
1349 public void RemoveObject(SceneObjectGroup sceneObject)
1338 { 1350 {
1339 if (Entities.ContainsKey(sceneObject.UUID)) 1351 if (Entities.ContainsKey(sceneObject.UUID))
1340 { 1352 {
@@ -3152,7 +3164,7 @@ namespace OpenSim.Region.Environment.Scenes
3152 3164
3153 lock (Entities) 3165 lock (Entities)
3154 { 3166 {
3155 RemoveEntity(group); 3167 RemoveObject(group);
3156 } 3168 }
3157 group.DeleteParts(); 3169 group.DeleteParts();
3158 3170
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
1841 1841
1842 SceneObjectGroup objectGroup = new SceneObjectGroup(m_scene, m_regionHandle, linkPart); 1842 SceneObjectGroup objectGroup = new SceneObjectGroup(m_scene, m_regionHandle, linkPart);
1843 1843
1844 m_scene.AddEntity(objectGroup); 1844 m_scene.AddObject(objectGroup);
1845 1845
1846 ScheduleGroupForFullUpdate(); 1846 ScheduleGroupForFullUpdate();
1847 } 1847 }
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
71 } 71 }
72 //if we want this to be a import method then we need new uuids for the object to avoid any clashes 72 //if we want this to be a import method then we need new uuids for the object to avoid any clashes
73 //obj.RegenerateFullIDs(); 73 //obj.RegenerateFullIDs();
74 m_innerScene.AddEntity(obj); 74
75 m_innerScene.AddObject(obj);
75 76
76 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); 77 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
77 // Apply loadOffsets for load/import and move combinations 78 // Apply loadOffsets for load/import and move combinations
@@ -183,7 +184,7 @@ namespace OpenSim.Region.Environment.Scenes
183 SceneObjectGroup obj = new SceneObjectGroup(xmlData); 184 SceneObjectGroup obj = new SceneObjectGroup(xmlData);
184 LLVector3 receivedVelocity = obj.RootPart.Velocity; 185 LLVector3 receivedVelocity = obj.RootPart.Velocity;
185 //System.Console.WriteLine(obj.RootPart.Velocity.ToString()); 186 //System.Console.WriteLine(obj.RootPart.Velocity.ToString());
186 m_innerScene.AddEntityFromStorage(obj); 187 m_innerScene.AddObjectFromStorage(obj);
187 188
188 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); 189 SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
189 bool UsePhysics = (((rootPart.GetEffectiveObjectFlags() & (uint) LLObject.ObjectFlags.Physics) > 0) && 190 bool UsePhysics = (((rootPart.GetEffectiveObjectFlags() & (uint) LLObject.ObjectFlags.Physics) > 0) &&