Bunch of fixes that reduce the number of times appearance

and avatar data are sent. And the number of times they
are stored.
This commit is contained in:
Master ScienceSim
2010-10-29 13:37:13 -07:00
parent 68666efd25
commit f5c9a56c8b
5 changed files with 132 additions and 81 deletions

View File

@@ -123,15 +123,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId);
// Save avatar attachment information
ScenePresence presence;
if (m_scene.AvatarService != null && m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
{
m_log.Info(
"[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId
+ ", AttachmentPoint: " + AttachmentPt);
m_log.Info(
"[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId
+ ", AttachmentPoint: " + AttachmentPt);
m_scene.AvatarService.SetAppearance(remoteClient.AgentId, presence.Appearance);
}
if (m_scene.AvatarFactory != null)
m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId);
}
}
catch (Exception e)
@@ -382,8 +379,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
item = m_scene.InventoryService.GetItem(item);
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */);
if (m_scene.AvatarService != null)
m_scene.AvatarService.SetAppearance(remoteClient.AgentId, presence.Appearance);
if (m_scene.AvatarFactory != null)
m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId);
}
}
@@ -405,11 +402,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
presence.Appearance.DetachAttachment(itemID);
// Save avatar attachment information
if (m_scene.AvatarService != null)
{
m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID);
m_scene.AvatarService.SetAppearance(remoteClient.AgentId, presence.Appearance);
}
m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID);
if (m_scene.AvatarFactory != null)
m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId);
}
DetachSingleAttachmentToInv(itemID, remoteClient);
@@ -435,10 +430,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
presence.Appearance.DetachAttachment(itemID);
if (m_scene.AvatarService != null)
{
m_scene.AvatarService.SetAppearance(remoteClient.AgentId, presence.Appearance);
}
if (m_scene.AvatarFactory != null)
m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId);
part.ParentGroup.DetachToGround();
List<UUID> uuids = new List<UUID>();