aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs34
1 files changed, 21 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 5604f49..1ebac42 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -190,7 +190,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
190 itemID = group.GetFromItemID(); 190 itemID = group.GetFromItemID();
191 } 191 }
192 192
193 SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group); 193 ShowAttachInUserInventory(remoteClient, AttachmentPt, itemID, group);
194 194
195 AttachToAgent(sp, group, AttachmentPt, attachPos, silent); 195 AttachToAgent(sp, group, AttachmentPt, attachPos, silent);
196 } 196 }
@@ -218,24 +218,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
218 218
219 public UUID RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt) 219 public UUID RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
220 { 220 {
221 m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name);
222
223 return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true); 221 return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true);
224 } 222 }
225 223
226 public UUID RezSingleAttachmentFromInventory( 224 public UUID RezSingleAttachmentFromInventory(
227 IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus) 225 IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus)
228 { 226 {
227 m_log.DebugFormat(
228 "[ATTACHMENTS MODULE]: Rezzing attachment to point {0} from item {1} for {2}",
229 (AttachmentPoint)AttachmentPt, itemID, remoteClient.Name);
230
229 SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt); 231 SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt);
230 232
231 if (updateInventoryStatus) 233 if (updateInventoryStatus)
232 { 234 {
233 if (att == null) 235 if (att == null)
234 {
235 ShowDetachInUserInventory(itemID, remoteClient); 236 ShowDetachInUserInventory(itemID, remoteClient);
236 } 237 else
237 238 ShowAttachInUserInventory(att, remoteClient, itemID, AttachmentPt);
238 SetAttachmentInventoryStatus(att, remoteClient, itemID, AttachmentPt);
239 } 239 }
240 240
241 if (null == att) 241 if (null == att)
@@ -300,12 +300,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
300 return null; 300 return null;
301 } 301 }
302 302
303 public UUID SetAttachmentInventoryStatus( 303 /// <summary>
304 /// Update the user inventory to the attachment of an item
305 /// </summary>
306 /// <param name="att"></param>
307 /// <param name="remoteClient"></param>
308 /// <param name="itemID"></param>
309 /// <param name="AttachmentPt"></param>
310 /// <returns></returns>
311 protected UUID ShowAttachInUserInventory(
304 SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) 312 SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
305 { 313 {
306 m_log.DebugFormat( 314// m_log.DebugFormat(
307 "[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} (item ID {2})", 315// "[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} (item ID {2})",
308 remoteClient.Name, att.Name, itemID); 316// remoteClient.Name, att.Name, itemID);
309 317
310 if (!att.IsDeleted) 318 if (!att.IsDeleted)
311 AttachmentPt = att.RootPart.AttachmentPoint; 319 AttachmentPt = att.RootPart.AttachmentPoint;
@@ -329,7 +337,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
329 /// <param name="AttachmentPt"></param> 337 /// <param name="AttachmentPt"></param>
330 /// <param name="itemID"></param> 338 /// <param name="itemID"></param>
331 /// <param name="att"></param> 339 /// <param name="att"></param>
332 public void SetAttachmentInventoryStatus( 340 protected void ShowAttachInUserInventory(
333 IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) 341 IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att)
334 { 342 {
335// m_log.DebugFormat( 343// m_log.DebugFormat(
@@ -387,7 +395,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
387 // Save avatar attachment information 395 // Save avatar attachment information
388 if (m_scene.AvatarFactory != null) 396 if (m_scene.AvatarFactory != null)
389 { 397 {
390 m_log.Debug("[ATTACHMENTS MODULE]: Dettaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); 398 m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID);
391 m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); 399 m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
392 } 400 }
393 } 401 }