コード例 #1
0
 private void EventManager_OnNewPresence(IScenePresence presence)
 {
     AvatarApperanceModule m = new AvatarApperanceModule(presence);
     presence.RegisterModuleInterface<IAvatarAppearanceModule>(m);
 }
コード例 #2
0
 protected void EventManager_OnNewPresence(IScenePresence presence)
 {
     presence.RegisterModuleInterface(new PerClientSelectionParticles(presence, this));
 }
コード例 #3
0
        public void RezAttachments (IScenePresence presence)
        {
            IAvatarAppearanceModule appearance = presence.RequestModuleInterface<IAvatarAppearanceModule> ();
            if(null == appearance || null == appearance.Appearance)
            {
                m_log.WarnFormat("[ATTACHMENT]: Appearance has not been initialized for agent {0}", presence.UUID);
                return;
            }
            
            //Create the avatar attachments plugin for the av
            AvatarAttachments attachmentsPlugin = new AvatarAttachments(presence);
            presence.RegisterModuleInterface <AvatarAttachments>(attachmentsPlugin);

            List<AvatarAttachment> attachments = appearance.Appearance.GetAttachments ();
            foreach (AvatarAttachment attach in attachments)
            {
                int p = attach.AttachPoint;
                UUID itemID = attach.ItemID;

                try
                {
                    RezSingleAttachmentFromInventory(presence.ControllingClient, itemID, p);
                }
                catch (Exception e)
                {
                    m_log.ErrorFormat("[ATTACHMENT]: Unable to rez attachment: {0}{1}", e.Message, e.StackTrace);
                }
            }

            foreach(IScenePresence sp in presence.Scene.GetScenePresences())
                sp.SceneViewer.QueuePresenceForFullUpdate(presence, true);
        }
コード例 #4
0
        public void ResumeAvatar(IScenePresence presence)
        {
            Util.FireAndForget(delegate
                                   {
                IAvatarAppearanceModule appearance = presence.RequestModuleInterface<IAvatarAppearanceModule>();
                if (null == appearance || null == appearance.Appearance)
                {
                    MainConsole.Instance.WarnFormat("[ATTACHMENT]: Appearance has not been initialized for agent {0}", presence.UUID);
                    return;
                }

                //Create the avatar attachments plugin for the av
                AvatarAttachments attachmentsPlugin = new AvatarAttachments(presence);
                presence.RegisterModuleInterface(attachmentsPlugin);

                List<AvatarAttachment> attachments = appearance.Appearance.GetAttachments();
                foreach (AvatarAttachment attach in attachments)
                {
                    try
                    {
                        RezSingleAttachmentFromInventory(presence.ControllingClient, attach.ItemID, 0);
                    }
                    catch (Exception e)
                    {
                        MainConsole.Instance.ErrorFormat("[ATTACHMENT]: Unable to rez attachment: {0}", e);
                    }
                }
            });
        }
コード例 #5
0
        public void ResumeAvatar(IScenePresence presence)
        {
            Util.FireAndForget(delegate
                                   {
                                       IAvatarAppearanceModule appearance =
                                           presence.RequestModuleInterface<IAvatarAppearanceModule>();
                                       if (null == appearance || null == appearance.Appearance)
                                       {
                                           MainConsole.Instance.WarnFormat(
                                               "[ATTACHMENT]: Appearance has not been initialized for agent {0}",
                                               presence.UUID);
                                           return;
                                       }

                                       //Create the avatar attachments plugin for the av
                                       AvatarAttachments attachmentsPlugin = new AvatarAttachments(presence);
                                       presence.RegisterModuleInterface(attachmentsPlugin);

                                       List<AvatarAttachment> attachments = appearance.Appearance.GetAttachments();
                                       MainConsole.Instance.InfoFormat(
                                           "[ATTACHMENTS MODULE]:  Found {0} attachments to attach to avatar {1}",
                                           attachments.Count, presence.Name);
                                       foreach (AvatarAttachment attach in attachments)
                                       {
                                           try
                                           {
                                               RezSingleAttachmentFromInventory(presence.ControllingClient,
                                                                                attach.ItemID, attach.AssetID, 0, false);
                                           }
                                           catch (Exception e)
                                           {
                                               MainConsole.Instance.ErrorFormat(
                                                   "[ATTACHMENT]: Unable to rez attachment: {0}", e);
                                           }
                                       }
                                       presence.AttachmentsLoaded = true;
                                       lock (_usersToSendAttachmentsToWhenLoaded)
                                       {
                                           if (_usersToSendAttachmentsToWhenLoaded.ContainsKey(presence.UUID))
                                           {
                                               foreach (var id in _usersToSendAttachmentsToWhenLoaded[presence.UUID])
                                               {
                                                   SendAttachmentsToPresence(id, presence);
                                               }
                                               _usersToSendAttachmentsToWhenLoaded.Remove(presence.UUID);
                                           }
                                       }
                                   });
        }
コード例 #6
0
 private void EventManager_OnNewPresence(IScenePresence presence)
 {
     ScriptControllerPresenceModule m = new ScriptControllerPresenceModule(presence);
     presence.RegisterModuleInterface<IScriptControllerModule>(m);
 }
コード例 #7
0
 private void NewPresence(IScenePresence presence)
 {
     presence.RegisterModuleInterface<ICombatPresence>(new CombatPresence(this, presence, m_config));
 }
コード例 #8
0
 protected void EventManager_OnNewPresence(IScenePresence presence)
 {
     presence.RegisterModuleInterface(new PerClientSelectionParticles(presence, this));
 }
コード例 #9
0
        void EventManager_OnNewPresence(IScenePresence presence)
        {
            AvatarApperanceModule m = new AvatarApperanceModule(presence);

            presence.RegisterModuleInterface <IAvatarAppearanceModule> (m);
        }
コード例 #10
0
        private void EventManager_OnNewPresence(IScenePresence presence)
        {
            ScriptControllerPresenceModule m = new ScriptControllerPresenceModule(presence);

            presence.RegisterModuleInterface <IScriptControllerModule>(m);
        }