diff options
author | Justin Clark-Casey (justincc) | 2010-03-12 22:48:49 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-03-12 22:48:49 +0000 |
commit | 582375509c82220c40579c4e4095225bd9d67010 (patch) | |
tree | 2d30da4db6f940fa22b36f41ee218e868cf369a0 /OpenSim/Region/CoreModules/Avatar | |
parent | refactor: move client invoked AttachObject from SceneGraph to AttachmentsModule (diff) | |
download | opensim-SC-582375509c82220c40579c4e4095225bd9d67010.zip opensim-SC-582375509c82220c40579c4e4095225bd9d67010.tar.gz opensim-SC-582375509c82220c40579c4e4095225bd9d67010.tar.bz2 opensim-SC-582375509c82220c40579c4e4095225bd9d67010.tar.xz |
refactor: move RezSingleAttachmentFromInventory() from SceneGraph to AttachmentsModule
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 3c2cc42..084f3c9 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -168,6 +168,52 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
168 | 168 | ||
169 | return true; | 169 | return true; |
170 | } | 170 | } |
171 | |||
172 | public SceneObjectGroup RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | ||
173 | { | ||
174 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); | ||
175 | if (invAccess != null) | ||
176 | { | ||
177 | SceneObjectGroup objatt = invAccess.RezObject(remoteClient, | ||
178 | itemID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, | ||
179 | false, false, remoteClient.AgentId, true); | ||
180 | |||
181 | // m_log.DebugFormat( | ||
182 | // "[ATTACHMENTS MODULE]: Retrieved single object {0} for attachment to {1} on point {2}", | ||
183 | // objatt.Name, remoteClient.Name, AttachmentPt); | ||
184 | |||
185 | if (objatt != null) | ||
186 | { | ||
187 | bool tainted = false; | ||
188 | if (AttachmentPt != 0 && AttachmentPt != objatt.GetAttachmentPoint()) | ||
189 | tainted = true; | ||
190 | |||
191 | AttachObject( | ||
192 | remoteClient, objatt.LocalId, AttachmentPt, Quaternion.Identity, objatt.AbsolutePosition, false); | ||
193 | //objatt.ScheduleGroupForFullUpdate(); | ||
194 | |||
195 | if (tainted) | ||
196 | objatt.HasGroupChanged = true; | ||
197 | |||
198 | // Fire after attach, so we don't get messy perms dialogs | ||
199 | // 3 == AttachedRez | ||
200 | objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 3); | ||
201 | |||
202 | // Do this last so that event listeners have access to all the effects of the attachment | ||
203 | m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId); | ||
204 | } | ||
205 | else | ||
206 | { | ||
207 | m_log.WarnFormat( | ||
208 | "[ATTACHMENTS MODULE]: Could not retrieve item {0} for attaching to avatar {1} at point {2}", | ||
209 | itemID, remoteClient.Name, AttachmentPt); | ||
210 | } | ||
211 | |||
212 | return objatt; | ||
213 | } | ||
214 | |||
215 | return null; | ||
216 | } | ||
171 | 217 | ||
172 | public UUID SetAttachmentInventoryStatus( | 218 | public UUID SetAttachmentInventoryStatus( |
173 | SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | 219 | SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) |