aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-03-03 22:14:06 +0000
committerJustin Clark-Casey (justincc)2010-03-09 18:53:04 +0000
commit5caae0293ab0f69cced21923c36db230698c7970 (patch)
treed9aadd6f5e7b159386e8633660955ee2805a5d2d /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
parentSmall consistency change (diff)
downloadopensim-SC_OLD-5caae0293ab0f69cced21923c36db230698c7970.zip
opensim-SC_OLD-5caae0293ab0f69cced21923c36db230698c7970.tar.gz
opensim-SC_OLD-5caae0293ab0f69cced21923c36db230698c7970.tar.bz2
opensim-SC_OLD-5caae0293ab0f69cced21923c36db230698c7970.tar.xz
Fix bug where approximately half the time, attachments would rez only their root prim until right clicked (or otherwise updated).
The root cause of this problem was that multiple ObjectUpdates were being sent on attachment which differed enough to confuse the client. Sometimes these would eliminate each other and sometimes not, depending on whether the scheduler looked at the queued updates. The solution here is to only schedule the ObjectUpdate once the attachment code has done all it needs to do. Backport from head.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs44
1 files changed, 37 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index c6cee75..5b21332 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2339,9 +2339,18 @@ namespace OpenSim.Region.Framework.Scenes
2339 EventManager.TriggerOnAttach(localID, itemID, avatarID); 2339 EventManager.TriggerOnAttach(localID, itemID, avatarID);
2340 } 2340 }
2341 2341
2342 public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID, 2342 /// <summary>
2343 uint AttachmentPt) 2343 /// Called when the client receives a request to rez a single attachment on to the avatar from inventory
2344 /// (RezSingleAttachmentFromInv packet).
2345 /// </summary>
2346 /// <param name="remoteClient"></param>
2347 /// <param name="itemID"></param>
2348 /// <param name="AttachmentPt"></param>
2349 /// <returns></returns>
2350 public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
2344 { 2351 {
2352 m_log.DebugFormat("[USER INVENTORY]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name);
2353
2345 SceneObjectGroup att = m_sceneGraph.RezSingleAttachment(remoteClient, itemID, AttachmentPt); 2354 SceneObjectGroup att = m_sceneGraph.RezSingleAttachment(remoteClient, itemID, AttachmentPt);
2346 2355
2347 if (att == null) 2356 if (att == null)
@@ -2353,9 +2362,20 @@ namespace OpenSim.Region.Framework.Scenes
2353 return RezSingleAttachment(att, remoteClient, itemID, AttachmentPt); 2362 return RezSingleAttachment(att, remoteClient, itemID, AttachmentPt);
2354 } 2363 }
2355 2364
2356 public UUID RezSingleAttachment(SceneObjectGroup att, 2365 /// <summary>
2357 IClientAPI remoteClient, UUID itemID, uint AttachmentPt) 2366 /// Update the user inventory to reflect an attachment
2367 /// </summary>
2368 /// <param name="att"></param>
2369 /// <param name="remoteClient"></param>
2370 /// <param name="itemID"></param>
2371 /// <param name="AttachmentPt"></param>
2372 /// <returns></returns>
2373 public UUID RezSingleAttachment(SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
2358 { 2374 {
2375 m_log.DebugFormat(
2376 "[USER INVENTORY]: Updating inventory of {0} to show attachment of {1} (item ID {2})",
2377 remoteClient.Name, att.Name, itemID);
2378
2359 if (!att.IsDeleted) 2379 if (!att.IsDeleted)
2360 AttachmentPt = att.RootPart.AttachmentPoint; 2380 AttachmentPt = att.RootPart.AttachmentPoint;
2361 2381
@@ -2394,8 +2414,19 @@ namespace OpenSim.Region.Framework.Scenes
2394 return m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent); 2414 return m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent);
2395 } 2415 }
2396 2416
2417 /// <summary>
2418 /// This registers the item as attached in a user's inventory
2419 /// </summary>
2420 /// <param name="remoteClient"></param>
2421 /// <param name="AttachmentPt"></param>
2422 /// <param name="itemID"></param>
2423 /// <param name="att"></param>
2397 public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) 2424 public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att)
2398 { 2425 {
2426// m_log.DebugFormat(
2427// "[USER INVENTORY]: Updating attachment {0} for {1} at {2} using item ID {3}",
2428// att.Name, remoteClient.Name, AttachmentPt, itemID);
2429
2399 if (UUID.Zero == itemID) 2430 if (UUID.Zero == itemID)
2400 { 2431 {
2401 m_log.Error("[SCENE INVENTORY]: Unable to save attachment. Error inventory item ID."); 2432 m_log.Error("[SCENE INVENTORY]: Unable to save attachment. Error inventory item ID.");
@@ -2423,10 +2454,7 @@ namespace OpenSim.Region.Framework.Scenes
2423 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); 2454 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
2424 2455
2425 if (m_AvatarFactory != null) 2456 if (m_AvatarFactory != null)
2426 {
2427 m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); 2457 m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
2428 }
2429
2430 } 2458 }
2431 } 2459 }
2432 2460
@@ -2509,6 +2537,7 @@ namespace OpenSim.Region.Framework.Scenes
2509 { 2537 {
2510 sog.SetOwnerId(ownerID); 2538 sog.SetOwnerId(ownerID);
2511 sog.SetGroup(groupID, remoteClient); 2539 sog.SetGroup(groupID, remoteClient);
2540 sog.ScheduleGroupForFullUpdate();
2512 2541
2513 foreach (SceneObjectPart child in sog.Children.Values) 2542 foreach (SceneObjectPart child in sog.Children.Values)
2514 child.Inventory.ChangeInventoryOwner(ownerID); 2543 child.Inventory.ChangeInventoryOwner(ownerID);
@@ -2530,6 +2559,7 @@ namespace OpenSim.Region.Framework.Scenes
2530 sog.SetOwnerId(groupID); 2559 sog.SetOwnerId(groupID);
2531 sog.ApplyNextOwnerPermissions(); 2560 sog.ApplyNextOwnerPermissions();
2532 } 2561 }
2562
2533 } 2563 }
2534 2564
2535 foreach (uint localID in localIDs) 2565 foreach (uint localID in localIDs)