aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
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 ffbf745..b04871e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2349,9 +2349,18 @@ namespace OpenSim.Region.Framework.Scenes
2349 EventManager.TriggerOnAttach(localID, itemID, avatarID); 2349 EventManager.TriggerOnAttach(localID, itemID, avatarID);
2350 } 2350 }
2351 2351
2352 public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID, 2352 /// <summary>
2353 uint AttachmentPt) 2353 /// Called when the client receives a request to rez a single attachment on to the avatar from inventory
2354 /// (RezSingleAttachmentFromInv packet).
2355 /// </summary>
2356 /// <param name="remoteClient"></param>
2357 /// <param name="itemID"></param>
2358 /// <param name="AttachmentPt"></param>
2359 /// <returns></returns>
2360 public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
2354 { 2361 {
2362 m_log.DebugFormat("[USER INVENTORY]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name);
2363
2355 SceneObjectGroup att = m_sceneGraph.RezSingleAttachment(remoteClient, itemID, AttachmentPt); 2364 SceneObjectGroup att = m_sceneGraph.RezSingleAttachment(remoteClient, itemID, AttachmentPt);
2356 2365
2357 if (att == null) 2366 if (att == null)
@@ -2363,9 +2372,20 @@ namespace OpenSim.Region.Framework.Scenes
2363 return RezSingleAttachment(att, remoteClient, itemID, AttachmentPt); 2372 return RezSingleAttachment(att, remoteClient, itemID, AttachmentPt);
2364 } 2373 }
2365 2374
2366 public UUID RezSingleAttachment(SceneObjectGroup att, 2375 /// <summary>
2367 IClientAPI remoteClient, UUID itemID, uint AttachmentPt) 2376 /// Update the user inventory to reflect an attachment
2377 /// </summary>
2378 /// <param name="att"></param>
2379 /// <param name="remoteClient"></param>
2380 /// <param name="itemID"></param>
2381 /// <param name="AttachmentPt"></param>
2382 /// <returns></returns>
2383 public UUID RezSingleAttachment(SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
2368 { 2384 {
2385 m_log.DebugFormat(
2386 "[USER INVENTORY]: Updating inventory of {0} to show attachment of {1} (item ID {2})",
2387 remoteClient.Name, att.Name, itemID);
2388
2369 if (!att.IsDeleted) 2389 if (!att.IsDeleted)
2370 AttachmentPt = att.RootPart.AttachmentPoint; 2390 AttachmentPt = att.RootPart.AttachmentPoint;
2371 2391
@@ -2404,8 +2424,19 @@ namespace OpenSim.Region.Framework.Scenes
2404 return m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent); 2424 return m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent);
2405 } 2425 }
2406 2426
2427 /// <summary>
2428 /// This registers the item as attached in a user's inventory
2429 /// </summary>
2430 /// <param name="remoteClient"></param>
2431 /// <param name="AttachmentPt"></param>
2432 /// <param name="itemID"></param>
2433 /// <param name="att"></param>
2407 public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) 2434 public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att)
2408 { 2435 {
2436// m_log.DebugFormat(
2437// "[USER INVENTORY]: Updating attachment {0} for {1} at {2} using item ID {3}",
2438// att.Name, remoteClient.Name, AttachmentPt, itemID);
2439
2409 if (UUID.Zero == itemID) 2440 if (UUID.Zero == itemID)
2410 { 2441 {
2411 m_log.Error("[SCENE INVENTORY]: Unable to save attachment. Error inventory item ID."); 2442 m_log.Error("[SCENE INVENTORY]: Unable to save attachment. Error inventory item ID.");
@@ -2433,10 +2464,7 @@ namespace OpenSim.Region.Framework.Scenes
2433 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); 2464 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
2434 2465
2435 if (m_AvatarFactory != null) 2466 if (m_AvatarFactory != null)
2436 {
2437 m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); 2467 m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
2438 }
2439
2440 } 2468 }
2441 } 2469 }
2442 2470
@@ -2519,6 +2547,7 @@ namespace OpenSim.Region.Framework.Scenes
2519 { 2547 {
2520 sog.SetOwnerId(ownerID); 2548 sog.SetOwnerId(ownerID);
2521 sog.SetGroup(groupID, remoteClient); 2549 sog.SetGroup(groupID, remoteClient);
2550 sog.ScheduleGroupForFullUpdate();
2522 2551
2523 foreach (SceneObjectPart child in sog.Children.Values) 2552 foreach (SceneObjectPart child in sog.Children.Values)
2524 child.Inventory.ChangeInventoryOwner(ownerID); 2553 child.Inventory.ChangeInventoryOwner(ownerID);
@@ -2540,6 +2569,7 @@ namespace OpenSim.Region.Framework.Scenes
2540 sog.SetOwnerId(groupID); 2569 sog.SetOwnerId(groupID);
2541 sog.ApplyNextOwnerPermissions(); 2570 sog.ApplyNextOwnerPermissions();
2542 } 2571 }
2572
2543 } 2573 }
2544 2574
2545 foreach (uint localID in localIDs) 2575 foreach (uint localID in localIDs)