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).
parent
2ebb421331
commit
784263f5e3
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue