diff options
author | Justin Clark-Casey (justincc) | 2011-08-30 23:05:43 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-30 23:06:10 +0100 |
commit | 04bafd21221a789b83b039efd1c52e141944cde0 (patch) | |
tree | 7c889db25e5c4ba059f5a03bfaacf95f95966b70 /OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |
parent | add Name property to ISceneEntity (diff) | |
download | opensim-SC_OLD-04bafd21221a789b83b039efd1c52e141944cde0.zip opensim-SC_OLD-04bafd21221a789b83b039efd1c52e141944cde0.tar.gz opensim-SC_OLD-04bafd21221a789b83b039efd1c52e141944cde0.tar.bz2 opensim-SC_OLD-04bafd21221a789b83b039efd1c52e141944cde0.tar.xz |
refactor: Move ScenePresence.RezAttachments() into AttachmentsModule
This adds an incomplete IScenePresence to match ISceneEntity
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 02fd387..f6aea89 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -95,6 +95,44 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
95 | client.OnDetachAttachmentIntoInv -= DetachSingleAttachmentToInv; | 95 | client.OnDetachAttachmentIntoInv -= DetachSingleAttachmentToInv; |
96 | client.OnObjectDrop -= DetachSingleAttachmentToGround; | 96 | client.OnObjectDrop -= DetachSingleAttachmentToGround; |
97 | } | 97 | } |
98 | |||
99 | /// <summary> | ||
100 | /// RezAttachments. This should only be called upon login on the first region. | ||
101 | /// Attachment rezzings on crossings and TPs are done in a different way. | ||
102 | /// </summary> | ||
103 | public void RezAttachments(IScenePresence sp) | ||
104 | { | ||
105 | if (null == sp.Appearance) | ||
106 | { | ||
107 | m_log.WarnFormat("[ATTACHMENTS MODULE]: Appearance has not been initialized for agent {0}", sp.UUID); | ||
108 | return; | ||
109 | } | ||
110 | |||
111 | List<AvatarAttachment> attachments = sp.Appearance.GetAttachments(); | ||
112 | foreach (AvatarAttachment attach in attachments) | ||
113 | { | ||
114 | int p = attach.AttachPoint; | ||
115 | UUID itemID = attach.ItemID; | ||
116 | |||
117 | //UUID assetID = attach.AssetID; | ||
118 | // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down | ||
119 | // But they're not used anyway, the item is being looked up for now, so let's proceed. | ||
120 | //if (UUID.Zero == assetID) | ||
121 | //{ | ||
122 | // m_log.DebugFormat("[ATTACHMENT]: Cannot rez attachment in point {0} with itemID {1}", p, itemID); | ||
123 | // continue; | ||
124 | //} | ||
125 | |||
126 | try | ||
127 | { | ||
128 | RezSingleAttachmentFromInventory(sp.ControllingClient, itemID, (uint)p); | ||
129 | } | ||
130 | catch (Exception e) | ||
131 | { | ||
132 | m_log.ErrorFormat("[ATTACHMENTS MODULE]: Unable to rez attachment: {0}{1}", e.Message, e.StackTrace); | ||
133 | } | ||
134 | } | ||
135 | } | ||
98 | 136 | ||
99 | /// <summary> | 137 | /// <summary> |
100 | /// Called by client | 138 | /// Called by client |