aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-09-13 20:25:32 +0100
committerJustin Clark-Casey (justincc)2011-09-13 20:25:32 +0100
commit618277e797c7d501f98e884e50abd313498cf00b (patch)
tree7854d60ddb9d0ac5957194f274a41b44cfd636d7 /OpenSim/Region
parentstop the duplicate remove of the root part ids from the full part and local p... (diff)
downloadopensim-SC_OLD-618277e797c7d501f98e884e50abd313498cf00b.zip
opensim-SC_OLD-618277e797c7d501f98e884e50abd313498cf00b.tar.gz
opensim-SC_OLD-618277e797c7d501f98e884e50abd313498cf00b.tar.bz2
opensim-SC_OLD-618277e797c7d501f98e884e50abd313498cf00b.tar.xz
Comment out attachments code in Scene.IncomingCreateObject(UUID userID, UUID itemID) for now
As far as I can see, this is only invoked by a PUT request to ObjectHandlers, which is not being used anyway. Invoking attachments code at this point is probably inappropriate since it would still be invoked when the client entered the scene. Being commented to simplify analysis of attachments issues. Can be uncommented when in use. Also, small tweak to lock and log removal of a SOG from the SceneObjectGroupsByLocalPartID collection in SceneGraph.GetGroupByPrim() if an inconsistency is found.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs25
3 files changed, 47 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 2fa233b..c817559 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -143,6 +143,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
143 143
144 public void SaveChangedAttachments(IScenePresence sp) 144 public void SaveChangedAttachments(IScenePresence sp)
145 { 145 {
146// m_log.DebugFormat("[ATTACHMENTS MODULE]: Saving changed attachments for {0}", sp.Name);
147
146 foreach (SceneObjectGroup grp in sp.GetAttachments()) 148 foreach (SceneObjectGroup grp in sp.GetAttachments())
147 { 149 {
148 if (grp.HasGroupChanged) // Resizer scripts? 150 if (grp.HasGroupChanged) // Resizer scripts?
@@ -242,9 +244,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
242 { 244 {
243 lock (sp.AttachmentsSyncLock) 245 lock (sp.AttachmentsSyncLock)
244 { 246 {
245 // m_log.DebugFormat( 247// m_log.DebugFormat(
246 // "[ATTACHMENTS MODULE]: Attaching object {0} {1} to {2} point {3} from ground (silent = {4})", 248// "[ATTACHMENTS MODULE]: Attaching object {0} {1} to {2} point {3} from ground (silent = {4})",
247 // group.Name, group.LocalId, sp.Name, attachmentPt, silent); 249// group.Name, group.LocalId, sp.Name, attachmentPt, silent);
248 250
249 if (sp.GetAttachments(attachmentPt).Contains(group)) 251 if (sp.GetAttachments(attachmentPt).Contains(group))
250 { 252 {
@@ -365,6 +367,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
365 367
366 public ISceneEntity RezSingleAttachmentFromInventory(ScenePresence sp, UUID itemID, uint AttachmentPt) 368 public ISceneEntity RezSingleAttachmentFromInventory(ScenePresence sp, UUID itemID, uint AttachmentPt)
367 { 369 {
370// m_log.DebugFormat(
371// "[ATTACHMENTS MODULE]: RezSingleAttachmentFromInventory to point {0} from item {1} for {2}",
372// (AttachmentPoint)AttachmentPt, itemID, sp.Name);
373
368 // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should 374 // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should
369 // be removed when that functionality is implemented in opensim 375 // be removed when that functionality is implemented in opensim
370 AttachmentPt &= 0x7f; 376 AttachmentPt &= 0x7f;
@@ -485,6 +491,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
485 491
486 public void DetachObject(uint objectLocalID, IClientAPI remoteClient) 492 public void DetachObject(uint objectLocalID, IClientAPI remoteClient)
487 { 493 {
494// m_log.DebugFormat(
495// "[ATTACHMENTS MODULE]: DetachObject() for object {0} on {1}", objectLocalID, remoteClient.Name);
496
488 SceneObjectGroup group = m_scene.GetGroupByPrim(objectLocalID); 497 SceneObjectGroup group = m_scene.GetGroupByPrim(objectLocalID);
489 if (group != null) 498 if (group != null)
490 { 499 {
@@ -588,6 +597,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
588 // To LocalId or UUID, *THAT* is the question. How now Brown UUID?? 597 // To LocalId or UUID, *THAT* is the question. How now Brown UUID??
589 private void DetachSingleAttachmentToInv(UUID itemID, IScenePresence sp) 598 private void DetachSingleAttachmentToInv(UUID itemID, IScenePresence sp)
590 { 599 {
600// m_log.DebugFormat("[ATTACHMENTS MODULE]: Detaching item {0} to inventory for {1}", itemID, sp.Name);
601
591 if (itemID == UUID.Zero) // If this happened, someone made a mistake.... 602 if (itemID == UUID.Zero) // If this happened, someone made a mistake....
592 return; 603 return;
593 604
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a0a2624..c5c9260 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2461,14 +2461,16 @@ namespace OpenSim.Region.Framework.Scenes
2461 /// <returns>False</returns> 2461 /// <returns>False</returns>
2462 public virtual bool IncomingCreateObject(UUID userID, UUID itemID) 2462 public virtual bool IncomingCreateObject(UUID userID, UUID itemID)
2463 { 2463 {
2464 //m_log.DebugFormat(" >>> IncomingCreateObject(userID, itemID) <<< {0} {1}", userID, itemID); 2464 m_log.DebugFormat(" >>> IncomingCreateObject(userID, itemID) <<< {0} {1}", userID, itemID);
2465 2465
2466 ScenePresence sp = GetScenePresence(userID); 2466 // Commented out since this is as yet unused and is arguably not the appropriate place to do this, as
2467 if (sp != null && AttachmentsModule != null) 2467 // attachments are being rezzed elsewhere in AddNewClient()
2468 { 2468// ScenePresence sp = GetScenePresence(userID);
2469 uint attPt = (uint)sp.Appearance.GetAttachpoint(itemID); 2469// if (sp != null && AttachmentsModule != null)
2470 AttachmentsModule.RezSingleAttachmentFromInventory(sp.ControllingClient, itemID, attPt); 2470// {
2471 } 2471// uint attPt = (uint)sp.Appearance.GetAttachpoint(itemID);
2472// AttachmentsModule.RezSingleAttachmentFromInventory(sp.ControllingClient, itemID, attPt);
2473// }
2472 2474
2473 return false; 2475 return false;
2474 } 2476 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 46c22ca..f03cf7b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -431,6 +431,10 @@ namespace OpenSim.Region.Framework.Scenes
431 /// <returns>true if the object was deleted, false if there was no object to delete</returns> 431 /// <returns>true if the object was deleted, false if there was no object to delete</returns>
432 public bool DeleteSceneObject(UUID uuid, bool resultOfObjectLinked) 432 public bool DeleteSceneObject(UUID uuid, bool resultOfObjectLinked)
433 { 433 {
434// m_log.DebugFormat(
435// "[SCENE GRAPH]: Deleting scene object with uuid {0}, resultOfObjectLinked = {1}",
436// uuid, resultOfObjectLinked);
437
434 EntityBase entity; 438 EntityBase entity;
435 if (!Entities.TryGetValue(uuid, out entity) || (!(entity is SceneObjectGroup))) 439 if (!Entities.TryGetValue(uuid, out entity) || (!(entity is SceneObjectGroup)))
436 return false; 440 return false;
@@ -878,7 +882,8 @@ namespace OpenSim.Region.Framework.Scenes
878 if (Entities.TryGetValue(localID, out entity)) 882 if (Entities.TryGetValue(localID, out entity))
879 return entity as SceneObjectGroup; 883 return entity as SceneObjectGroup;
880 884
881 //m_log.DebugFormat("Entered GetGroupByPrim with localID {0}", localID); 885// m_log.DebugFormat("[SCENE GRAPH]: Entered GetGroupByPrim with localID {0}", localID);
886
882 SceneObjectGroup sog; 887 SceneObjectGroup sog;
883 lock (SceneObjectGroupsByLocalPartID) 888 lock (SceneObjectGroupsByLocalPartID)
884 SceneObjectGroupsByLocalPartID.TryGetValue(localID, out sog); 889 SceneObjectGroupsByLocalPartID.TryGetValue(localID, out sog);
@@ -886,8 +891,24 @@ namespace OpenSim.Region.Framework.Scenes
886 if (sog != null) 891 if (sog != null)
887 { 892 {
888 if (sog.HasChildPrim(localID)) 893 if (sog.HasChildPrim(localID))
894 {
895// m_log.DebugFormat(
896// "[SCENE GRAPH]: Found scene object {0} {1} {2} containing part with local id {3} in {4}. Returning.",
897// sog.Name, sog.UUID, sog.LocalId, localID, m_parentScene.RegionInfo.RegionName);
898
889 return sog; 899 return sog;
890 SceneObjectGroupsByLocalPartID.Remove(localID); 900 }
901 else
902 {
903 lock (SceneObjectGroupsByLocalPartID)
904 {
905 m_log.WarnFormat(
906 "[SCENE GRAPH]: Found scene object {0} {1} {2} via SceneObjectGroupsByLocalPartID index but it doesn't contain part with local id {3}. Removing from entry from index in {4}.",
907 sog.Name, sog.UUID, sog.LocalId, localID, m_parentScene.RegionInfo.RegionName);
908
909 SceneObjectGroupsByLocalPartID.Remove(localID);
910 }
911 }
891 } 912 }
892 913
893 EntityBase[] entityList = GetEntities(); 914 EntityBase[] entityList = GetEntities();