示例#1
0
        /// <summary>
        /// Remove a specific script (and all its pending commands)
        /// </summary>
        /// <param name="localID"></param>
        /// <param name="itemID"></param>
        public static void RemoveScript(IScriptEngine engine, uint localID, UUID itemID)
        {
            // Remove a specific script

            // Remove dataserver events
            m_Dataserver[engine].RemoveEvents(localID, itemID);

            // Remove from: Timers
            m_Timer[engine].UnSetTimerEvents(localID, itemID);

            // Remove from: HttpRequest
            IHttpRequestModule iHttpReq =
                engine.World.RequestModuleInterface <IHttpRequestModule>();

            iHttpReq.StopHttpRequest(localID, itemID);

            IWorldComm comms = engine.World.RequestModuleInterface <IWorldComm>();

            if (comms != null)
            {
                comms.DeleteListener(itemID);
            }

            IXMLRPC xmlrpc = engine.World.RequestModuleInterface <IXMLRPC>();

            xmlrpc.DeleteChannels(itemID);
            xmlrpc.CancelSRDRequests(itemID);

            // Remove Sensors
            m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID);
        }
示例#2
0
        /// <summary>
        /// Unregister a specific script from facilities (and all its pending commands)
        /// </summary>
        /// <param name="localID"></param>
        /// <param name="itemID"></param>
        public static void UnregisterScriptFacilities(IScriptEngine engine, uint localID, UUID itemID, bool resetScript)
        {
//            m_log.DebugFormat("[ASYNC COMMAND MANAGER]: Removing facilities for script {0}", itemID);

            staticLock.AcquireReaderLock(-1);
            try
            {
                // Remove dataserver events
                m_Dataserver[engine].RemoveEvents(localID, itemID);

                if (resetScript)
                {
                    // Remove from: Timers
                    m_Timer[engine].UnSetTimerEvents(localID, itemID);

                    // Remove from: HttpRequest
                    IHttpRequestModule iHttpReq = engine.World.RequestModuleInterface <IHttpRequestModule>();
                    if (iHttpReq != null)
                    {
                        iHttpReq.StopHttpRequestsForScript(itemID);
                    }
                }

                IWorldComm comms = engine.World.RequestModuleInterface <IWorldComm>();
                if (comms != null)
                {
                    comms.DeleteListener(itemID);
                }

                IXMLRPC xmlrpc = engine.World.RequestModuleInterface <IXMLRPC>();
                if (xmlrpc != null)
                {
                    xmlrpc.DeleteChannels(itemID);
                    xmlrpc.CancelSRDRequests(itemID);
                }

                // Remove Sensors
                m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID);
            }
            finally
            {
                staticLock.ReleaseReaderLock();
            }
        }
        /// <summary>
        /// Remove a specific script (and all its pending commands)
        /// </summary>
        /// <param name="localID"></param>
        /// <param name="itemID"></param>
        public static void RemoveScript(IScriptEngine engine, uint localID, UUID itemID)
        {
            // Remove a specific script
            //            m_log.DebugFormat("[ASYNC COMMAND MANAGER]: Removing facilities for script {0}", itemID);

            lock (staticLock)
            {
                // Remove dataserver events
                m_Dataserver[engine].RemoveEvents(localID, itemID);

                // Remove from: Timers
                m_Timer[engine].UnSetTimerEvents(localID, itemID);

                if (engine.World != null)
                {
                    // Remove from: HttpRequest
                    IHttpRequestModule iHttpReq = engine.World.RequestModuleInterface <IHttpRequestModule>();
                    if (iHttpReq != null)
                    {
                        iHttpReq.StopHttpRequest(localID, itemID);
                    }

                    IWorldComm comms = engine.World.RequestModuleInterface <IWorldComm>();
                    if (comms != null)
                    {
                        comms.DeleteListener(itemID);
                    }

                    IXMLRPC xmlrpc = engine.World.RequestModuleInterface <IXMLRPC>();
                    if (xmlrpc != null)
                    {
                        xmlrpc.DeleteChannels(itemID);
                        xmlrpc.CancelSRDRequests(itemID);
                    }
                }
                // Remove Sensors
                m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID);
            }
        }