void OnSetAgentLeaving(IScenePresence presence, Interfaces.GridRegion destination) { IAttachmentsModule attModule = presence.Scene.RequestModuleInterface <IAttachmentsModule>(); if (attModule != null) { m_userAttachments[presence.UUID] = attModule.GetAttachmentsForAvatar(presence.UUID); } }
void KillAttachments(IScenePresence agent) { IAttachmentsModule attModule = agent.Scene.RequestModuleInterface <IAttachmentsModule> (); if (attModule != null) { ISceneEntity [] attachments = attModule.GetAttachmentsForAvatar(agent.UUID); foreach (ISceneEntity grp in attachments) { // Kill in all clients as it will be re-added in the other region KillEntities(agent, grp.ChildrenEntities().ToArray()); // Now remove it from the Scene so that it will not come back agent.Scene.SceneGraph.DeleteEntity(grp); } } }
protected void SendFullUpdateForPresence(IScenePresence presence) { Util.FireAndForget(delegate { m_presence.ControllingClient.SendAvatarDataImmediate(presence); //Send the animations too presence.Animator.SendAnimPackToClient(m_presence.ControllingClient); //Send the presence of this agent to us IAvatarAppearanceModule module = presence.RequestModuleInterface <IAvatarAppearanceModule>(); if (module != null) { module.SendAppearanceToAgent(m_presence); } //We need to send all attachments of this avatar as well IAttachmentsModule attmodule = m_presence.Scene.RequestModuleInterface <IAttachmentsModule>(); if (attmodule != null) { ISceneEntity[] entities = attmodule.GetAttachmentsForAvatar(m_presence.UUID); foreach (ISceneEntity entity in entities) { QueuePartForUpdate(entity.RootChild, PrimUpdateFlags.ForcedFullUpdate); #if (!ISWIN) foreach (ISceneChildEntity child in entity.ChildrenEntities()) { if (!child.IsRoot) { QueuePartForUpdate(child, PrimUpdateFlags.ForcedFullUpdate); } } #else foreach (ISceneChildEntity child in entity.ChildrenEntities().Where(child => !child.IsRoot)) { QueuePartForUpdate(child, PrimUpdateFlags.ForcedFullUpdate); } #endif } } }); }