diff options
author | Justin Clark-Casey (justincc) | 2010-03-12 23:20:38 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-03-12 23:20:38 +0000 |
commit | 315fa06c75d023ef3e4285842dd730a4d94b78d6 (patch) | |
tree | 370ec91ab832e2f24e57c17cf32aea5baa84953d /OpenSim/Region/Framework/Scenes | |
parent | Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-315fa06c75d023ef3e4285842dd730a4d94b78d6.zip opensim-SC_OLD-315fa06c75d023ef3e4285842dd730a4d94b78d6.tar.gz opensim-SC_OLD-315fa06c75d023ef3e4285842dd730a4d94b78d6.tar.bz2 opensim-SC_OLD-315fa06c75d023ef3e4285842dd730a4d94b78d6.tar.xz |
refactor: Move another RezSingleAttachment() from Scene.Inventory to AttachmentsModule
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 25 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 12 |
3 files changed, 11 insertions, 34 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index dcd92d6..41533a1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1842,35 +1842,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1842 | EventManager.TriggerOnAttach(localID, itemID, avatarID); | 1842 | EventManager.TriggerOnAttach(localID, itemID, avatarID); |
1843 | } | 1843 | } |
1844 | 1844 | ||
1845 | /// <summary> | ||
1846 | /// Called when the client receives a request to rez a single attachment on to the avatar from inventory | ||
1847 | /// (RezSingleAttachmentFromInv packet). | ||
1848 | /// </summary> | ||
1849 | /// <param name="remoteClient"></param> | ||
1850 | /// <param name="itemID"></param> | ||
1851 | /// <param name="AttachmentPt"></param> | ||
1852 | /// <returns></returns> | ||
1853 | public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | ||
1854 | { | ||
1855 | m_log.DebugFormat("[USER INVENTORY]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name); | ||
1856 | |||
1857 | SceneObjectGroup att = AttachmentsModule.RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt); | ||
1858 | |||
1859 | if (att == null) | ||
1860 | { | ||
1861 | AttachmentsModule.ShowDetachInUserInventory(itemID, remoteClient); | ||
1862 | return UUID.Zero; | ||
1863 | } | ||
1864 | |||
1865 | return AttachmentsModule.SetAttachmentInventoryStatus(att, remoteClient, itemID, AttachmentPt); | ||
1866 | } | ||
1867 | |||
1868 | public void RezMultipleAttachments(IClientAPI remoteClient, RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header, | 1845 | public void RezMultipleAttachments(IClientAPI remoteClient, RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header, |
1869 | RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects) | 1846 | RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects) |
1870 | { | 1847 | { |
1871 | foreach (RezMultipleAttachmentsFromInvPacket.ObjectDataBlock obj in objects) | 1848 | foreach (RezMultipleAttachmentsFromInvPacket.ObjectDataBlock obj in objects) |
1872 | { | 1849 | { |
1873 | RezSingleAttachment(remoteClient, obj.ItemID, obj.AttachmentPt); | 1850 | AttachmentsModule.RezSingleAttachmentFromInventory(remoteClient, obj.ItemID, obj.AttachmentPt); |
1874 | } | 1851 | } |
1875 | } | 1852 | } |
1876 | 1853 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 50553dd..c510dc8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2642,13 +2642,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2642 | } | 2642 | } |
2643 | 2643 | ||
2644 | public virtual void SubscribeToClientAttachmentEvents(IClientAPI client) | 2644 | public virtual void SubscribeToClientAttachmentEvents(IClientAPI client) |
2645 | { | 2645 | { |
2646 | client.OnRezSingleAttachmentFromInv += RezSingleAttachment; | ||
2647 | client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments; | 2646 | client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments; |
2648 | client.OnObjectDetach += m_sceneGraph.DetachObject; | 2647 | client.OnObjectDetach += m_sceneGraph.DetachObject; |
2649 | 2648 | ||
2650 | if (AttachmentsModule != null) | 2649 | if (AttachmentsModule != null) |
2651 | { | 2650 | { |
2651 | client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory; | ||
2652 | client.OnObjectAttach += AttachmentsModule.AttachObject; | 2652 | client.OnObjectAttach += AttachmentsModule.AttachObject; |
2653 | client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory; | 2653 | client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory; |
2654 | } | 2654 | } |
@@ -2799,12 +2799,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2799 | 2799 | ||
2800 | public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client) | 2800 | public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client) |
2801 | { | 2801 | { |
2802 | client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachments; | 2802 | client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachments; |
2803 | client.OnRezSingleAttachmentFromInv -= RezSingleAttachment; | ||
2804 | client.OnObjectDetach -= m_sceneGraph.DetachObject; | 2803 | client.OnObjectDetach -= m_sceneGraph.DetachObject; |
2805 | 2804 | ||
2806 | if (AttachmentsModule != null) | 2805 | if (AttachmentsModule != null) |
2807 | { | 2806 | { |
2807 | client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory; | ||
2808 | client.OnObjectAttach -= AttachmentsModule.AttachObject; | 2808 | client.OnObjectAttach -= AttachmentsModule.AttachObject; |
2809 | client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory; | 2809 | client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory; |
2810 | } | 2810 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7661f1e..317c908 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3738,7 +3738,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3738 | { | 3738 | { |
3739 | if (null == m_appearance) | 3739 | if (null == m_appearance) |
3740 | { | 3740 | { |
3741 | m_log.WarnFormat("[ATTACHMENT] Appearance has not been initialized for agent {0}", UUID); | 3741 | m_log.WarnFormat("[ATTACHMENT]: Appearance has not been initialized for agent {0}", UUID); |
3742 | return; | 3742 | return; |
3743 | } | 3743 | } |
3744 | 3744 | ||
@@ -3762,12 +3762,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3762 | try | 3762 | try |
3763 | { | 3763 | { |
3764 | // Rez from inventory | 3764 | // Rez from inventory |
3765 | UUID asset = m_scene.RezSingleAttachment(ControllingClient, | 3765 | UUID asset |
3766 | itemID, (uint)p); | 3766 | = m_scene.AttachmentsModule.RezSingleAttachmentFromInventory(ControllingClient, itemID, (uint)p); |
3767 | |||
3768 | m_log.InfoFormat("[ATTACHMENT]: Rezzed attachment in point {0} from item {1} and asset {2} ({3})", | ||
3769 | p, itemID, assetID, asset); | ||
3770 | 3767 | ||
3768 | m_log.InfoFormat( | ||
3769 | "[ATTACHMENT]: Rezzed attachment in point {0} from item {1} and asset {2} ({3})", | ||
3770 | p, itemID, assetID, asset); | ||
3771 | } | 3771 | } |
3772 | catch (Exception e) | 3772 | catch (Exception e) |
3773 | { | 3773 | { |