aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/InnerScene.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-05-24 23:11:07 +0000
committerJustin Clarke Casey2008-05-24 23:11:07 +0000
commit0ee69707ea8c0948b79aeba5dbe078fe28dc6482 (patch)
treed470d18bdac7f6be37103710400bb4deb8f9871b /OpenSim/Region/Environment/Scenes/InnerScene.cs
parent* Refactor: Remove some unused methods in Scene/InnerScene (diff)
downloadopensim-SC_OLD-0ee69707ea8c0948b79aeba5dbe078fe28dc6482.zip
opensim-SC_OLD-0ee69707ea8c0948b79aeba5dbe078fe28dc6482.tar.gz
opensim-SC_OLD-0ee69707ea8c0948b79aeba5dbe078fe28dc6482.tar.bz2
opensim-SC_OLD-0ee69707ea8c0948b79aeba5dbe078fe28dc6482.tar.xz
* Refactor: Collapse some multiple remove object paths
* Push some delete functionality into InnerScene to match what's already there for adding objects
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs41
1 files changed, 33 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 63f7f17..b03ffe2 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -204,18 +204,45 @@ namespace OpenSim.Region.Environment.Scenes
204 /// Add an object to the scene. 204 /// Add an object to the scene.
205 /// </summary> 205 /// </summary>
206 /// <param name="sceneObject"></param> 206 /// <param name="sceneObject"></param>
207 public void AddSceneObject(SceneObjectGroup sceneObject) 207 /// <returns>true if the object was added, false if an object with the same uuid was already in the scene
208 /// </returns>
209 public bool AddSceneObject(SceneObjectGroup sceneObject)
208 { 210 {
209 if (!Entities.ContainsKey(sceneObject.UUID)) 211 lock (Entities)
210 { 212 {
211 // QuadTree.AddSceneObject(sceneObject); 213 if (!Entities.ContainsKey(sceneObject.UUID))
212 lock (Entities)
213 { 214 {
215 // QuadTree.AddSceneObject(sceneObject);
214 Entities.Add(sceneObject.UUID, sceneObject); 216 Entities.Add(sceneObject.UUID, sceneObject);
217 m_numPrim++;
218
219 return true;
215 } 220 }
216 m_numPrim++; 221
222 return false;
217 } 223 }
218 } 224 }
225
226 /// <summary>
227 /// Delete an object from the scene
228 /// </summary>
229 /// <param name="sceneObject"></param>
230 /// <returns>true if the object was deleted, false if there was no object to delete</returns>
231 public bool DeleteSceneObject(LLUUID uuid)
232 {
233 lock (Entities)
234 {
235 if (Entities.ContainsKey(uuid))
236 {
237 Entities.Remove(uuid);
238 m_numPrim--;
239
240 return true;
241 }
242 }
243
244 return false;
245 }
219 246
220 /// <summary> 247 /// <summary>
221 /// Add an entity to the list of prims to process on the next update 248 /// Add an entity to the list of prims to process on the next update
@@ -376,7 +403,6 @@ namespace OpenSim.Region.Environment.Scenes
376 // To LocalId or LLUUID, *THAT* is the question. How now Brown LLUUID?? 403 // To LocalId or LLUUID, *THAT* is the question. How now Brown LLUUID??
377 public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient) 404 public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient)
378 { 405 {
379
380 if (itemID == LLUUID.Zero) // If this happened, someone made a mistake.... 406 if (itemID == LLUUID.Zero) // If this happened, someone made a mistake....
381 return; 407 return;
382 408
@@ -392,11 +418,10 @@ namespace OpenSim.Region.Environment.Scenes
392 group.DetachToInventoryPrep(); 418 group.DetachToInventoryPrep();
393 m_log.Debug("[DETACH]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString()); 419 m_log.Debug("[DETACH]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString());
394 m_parentScene.updateKnownAsset(remoteClient, group, group.GetFromAssetID(),group.OwnerID); 420 m_parentScene.updateKnownAsset(remoteClient, group, group.GetFromAssetID(),group.OwnerID);
395 m_parentScene.DeleteSceneObjectGroup(group); 421 m_parentScene.DeleteSceneObject(group);
396 } 422 }
397 } 423 }
398 } 424 }
399
400 } 425 }
401 426
402 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot, LLVector3 attachPos) 427 public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, LLQuaternion rot, LLVector3 attachPos)