diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 4 |
2 files changed, 13 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 360a014..ff26264 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -132,8 +132,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
132 | "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId | 132 | "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId |
133 | + ", AttachmentPoint: " + AttachmentPt); | 133 | + ", AttachmentPoint: " + AttachmentPt); |
134 | 134 | ||
135 | if (m_scene.AvatarFactory != null) | ||
136 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); | ||
137 | } | 135 | } |
138 | } | 136 | } |
139 | catch (Exception e) | 137 | catch (Exception e) |
@@ -336,7 +334,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
336 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 334 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
337 | item = m_scene.InventoryService.GetItem(item); | 335 | item = m_scene.InventoryService.GetItem(item); |
338 | 336 | ||
339 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | 337 | bool changed = presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID); |
338 | if (changed && m_scene.AvatarFactory != null) | ||
339 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); | ||
340 | } | 340 | } |
341 | 341 | ||
342 | return att.UUID; | 342 | return att.UUID; |
@@ -380,9 +380,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
380 | // XXYY!! | 380 | // XXYY!! |
381 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 381 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
382 | item = m_scene.InventoryService.GetItem(item); | 382 | item = m_scene.InventoryService.GetItem(item); |
383 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); | 383 | bool changed = presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID); |
384 | 384 | if (changed && m_scene.AvatarFactory != null) | |
385 | if (m_scene.AvatarFactory != null) | ||
386 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); | 385 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); |
387 | } | 386 | } |
388 | } | 387 | } |
@@ -402,11 +401,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
402 | ScenePresence presence; | 401 | ScenePresence presence; |
403 | if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) | 402 | if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) |
404 | { | 403 | { |
405 | presence.Appearance.DetachAttachment(itemID); | ||
406 | |||
407 | // Save avatar attachment information | 404 | // Save avatar attachment information |
408 | m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); | 405 | m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); |
409 | if (m_scene.AvatarFactory != null) | 406 | |
407 | bool changed = presence.Appearance.DetachAttachment(itemID); | ||
408 | if (changed && m_scene.AvatarFactory != null) | ||
410 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); | 409 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); |
411 | } | 410 | } |
412 | 411 | ||
@@ -431,9 +430,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
431 | part.ParentGroup.PrimCount, remoteClient.AgentId, presence.AbsolutePosition)) | 430 | part.ParentGroup.PrimCount, remoteClient.AgentId, presence.AbsolutePosition)) |
432 | return; | 431 | return; |
433 | 432 | ||
434 | presence.Appearance.DetachAttachment(itemID); | 433 | bool changed = presence.Appearance.DetachAttachment(itemID); |
435 | 434 | if (changed && m_scene.AvatarFactory != null) | |
436 | if (m_scene.AvatarFactory != null) | ||
437 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); | 435 | m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); |
438 | 436 | ||
439 | part.ParentGroup.DetachToGround(); | 437 | part.ParentGroup.DetachToGround(); |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index ed0a290..f8ce444 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -217,7 +217,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
217 | // update transaction. In theory, we should be able to do an immediate | 217 | // update transaction. In theory, we should be able to do an immediate |
218 | // appearance send and save here. | 218 | // appearance send and save here. |
219 | 219 | ||
220 | QueueAppearanceSave(client.AgentId); | 220 | // save only if there were changes, send no matter what (doesn't hurt to send twice) |
221 | if (changed) | ||
222 | QueueAppearanceSave(client.AgentId); | ||
221 | QueueAppearanceSend(client.AgentId); | 223 | QueueAppearanceSend(client.AgentId); |
222 | } | 224 | } |
223 | 225 | ||