diff options
author | Justin Clarke Casey | 2008-05-24 22:10:14 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-05-24 22:10:14 +0000 |
commit | 79eecd3d25ccc701d5b2aba77f034c03a20b6556 (patch) | |
tree | 188b83286b22fa7f655149a9494a834985fe0e8e | |
parent | * Refactor: Push some dictionary initialization down from Scene into InnerScene (diff) | |
download | opensim-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
8 files changed, 46 insertions, 22 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) && |
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 | |||
126 | if (m_parts.Count == 1) | 126 | if (m_parts.Count == 1) |
127 | { | 127 | { |
128 | m_parts.Remove(m_rootPart.UUID); | 128 | m_parts.Remove(m_rootPart.UUID); |
129 | m_scene.RemoveEntity(this); | 129 | m_scene.RemoveObject(this); |
130 | remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalId); | 130 | remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalId); |
131 | remoteClient.AddMoney(50); | 131 | remoteClient.AddMoney(50); |
132 | remoteClient.SendChatMessage("KABLAM!!!", 1, AbsolutePosition, "Groupie Groupie", LLUUID.Zero, (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully); | 132 | 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 | |||
76 | } | 76 | } |
77 | 77 | ||
78 | FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos); | 78 | FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos); |
79 | m_scene.AddEntity(fileObject); | 79 | m_scene.AddObject(fileObject); |
80 | fileObject.ScheduleGroupForFullUpdate(); | 80 | fileObject.ScheduleGroupForFullUpdate(); |
81 | } | 81 | } |
82 | } | 82 | } |
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
107 | ComplexObject complexObject = | 107 | ComplexObject complexObject = |
108 | new ComplexObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), | 108 | new ComplexObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), |
109 | pos + posOffset); | 109 | pos + posOffset); |
110 | m_scene.AddEntity(complexObject); | 110 | m_scene.AddObject(complexObject); |
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
@@ -116,7 +116,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
116 | SceneObjectGroup sceneObject = | 116 | SceneObjectGroup sceneObject = |
117 | new CpuCounterObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), | 117 | new CpuCounterObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), |
118 | pos + new LLVector3(1f, 1f, 1f)); | 118 | pos + new LLVector3(1f, 1f, 1f)); |
119 | m_scene.AddEntity(sceneObject); | 119 | m_scene.AddObject(sceneObject); |
120 | } | 120 | } |
121 | 121 | ||
122 | public void Close() | 122 | public void Close() |