Added the TriggerAvatarAppearanceChanged to EventManager. It's triggered by AvatarFactoryModule after an avatar's appearance has been succesfully changed and persisted (if the persist option is set).

xassetservice
Dan Lake 2012-02-17 13:43:14 -08:00
parent 2ebb421331
commit 784263f5e3
2 changed files with 28 additions and 0 deletions

View File

@ -496,6 +496,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
SetAppearanceAssets(sp.UUID, sp.Appearance);
m_scene.AvatarService.SetAppearance(agentid, sp.Appearance);
// Trigger this here because it's the final step in the set/queue/save process for appearance setting.
// Everything has been updated and stored. Ensures bakes have been persisted (if option is set to persist bakes).
m_scene.EventManager.TriggerAvatarAppearanceChanged(sp);
}
private void SetAppearanceAssets(UUID userID, AvatarAppearance appearance)

View File

@ -173,6 +173,9 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID);
public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
public delegate void AvatarAppearanceChange(ScenePresence avatar);
public event AvatarAppearanceChange OnAvatarAppearanceChange;
public event Action<ScenePresence> OnSignificantClientMovement;
public delegate void IncomingInstantMessage(GridInstantMessage message);
@ -1238,6 +1241,27 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public void TriggerAvatarAppearanceChanged(ScenePresence avatar)
{
AvatarAppearanceChange handler = OnAvatarAppearanceChange;
if (handler != null)
{
foreach (AvatarAppearanceChange d in handler.GetInvocationList())
{
try
{
d(avatar);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}",
e.Message, e.StackTrace);
}
}
}
}
public void TriggerIncomingInstantMessage(GridInstantMessage message)
{
IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage;