aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorMike Mazur2008-11-06 06:23:58 +0000
committerMike Mazur2008-11-06 06:23:58 +0000
commit5d8e08a0726ed49806e2009b37d3e917e279274f (patch)
tree69418e0bb294d15ddd6ae1573dd84b3c109f49db /OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
parentThanks Diva for a patch that makes WorldMapModule friendly to subclassing. (diff)
downloadopensim-SC-5d8e08a0726ed49806e2009b37d3e917e279274f.zip
opensim-SC-5d8e08a0726ed49806e2009b37d3e917e279274f.tar.gz
opensim-SC-5d8e08a0726ed49806e2009b37d3e917e279274f.tar.bz2
opensim-SC-5d8e08a0726ed49806e2009b37d3e917e279274f.tar.xz
- create entries in avatarattachments table when first attaching an object; fix issue 2512
- correct attachment offset; fix issue 2513 - thanks Thomas for the patches
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs37
1 files changed, 36 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index e2a0eec..8f38d39 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -1815,8 +1815,9 @@ namespace OpenSim.Region.Environment.Scenes
1815 } 1815 }
1816 } 1816 }
1817 1817
1818 public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId) 1818 public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId, out UUID itemID)
1819 { 1819 {
1820 itemID = UUID.Zero;
1820 if (grp != null) 1821 if (grp != null)
1821 { 1822 {
1822 string sceneObjectXml = grp.ToXmlString(); 1823 string sceneObjectXml = grp.ToXmlString();
@@ -1866,6 +1867,7 @@ namespace OpenSim.Region.Environment.Scenes
1866 userInfo.AddItem(item); 1867 userInfo.AddItem(item);
1867 remoteClient.SendInventoryItemCreateUpdate(item); 1868 remoteClient.SendInventoryItemCreateUpdate(item);
1868 1869
1870 itemID = item.ID;
1869 return item.AssetID; 1871 return item.AssetID;
1870 } 1872 }
1871 return UUID.Zero; 1873 return UUID.Zero;
@@ -2356,6 +2358,39 @@ namespace OpenSim.Region.Environment.Scenes
2356 m_innerScene.AttachObject(controllingClient, localID, attachPoint, rot, pos); 2358 m_innerScene.AttachObject(controllingClient, localID, attachPoint, rot, pos);
2357 } 2359 }
2358 2360
2361 public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att)
2362 {
2363 if (null == itemID)
2364 {
2365 m_log.Error("[SCENE INVENTORY]: Unable to save attachment. Error inventory item ID.");
2366 return;
2367 }
2368
2369 if (0 == AttachmentPt)
2370 {
2371 m_log.Error("[SCENE INVENTORY]: Unable to save attachment. Error attachment point.");
2372 return;
2373 }
2374
2375 if (null == att.RootPart)
2376 {
2377 m_log.Error("[SCENE INVENTORY]: Unable to save attachment for a prim without the rootpart!");
2378 return;
2379 }
2380
2381 ScenePresence presence;
2382 if (TryGetAvatar(remoteClient.AgentId, out presence))
2383 {
2384 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, att.UUID);
2385 IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>();
2386 if (ava != null)
2387 {
2388 m_log.InfoFormat("[SCENE INVENTORY]: Saving avatar attachment. AgentID:{0} ItemID:{1} AttachmentPoint:{2}", remoteClient.AgentId, itemID, AttachmentPt);
2389 ava.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
2390 }
2391 }
2392 }
2393
2359 public void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient) 2394 public void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient)
2360 { 2395 {
2361 SceneObjectPart part = GetSceneObjectPart(itemID); 2396 SceneObjectPart part = GetSceneObjectPart(itemID);