示例#1
0
        public byte[] GetBinaryStateSnapshot(OpenMetaverse.UUID itemID, StopScriptReason stopScriptReason)
        {
            if (!_masterScheduler.IsRunning)
            {
                _log.ErrorFormat("[Phlox]: Unable to retrieve state data for {0} master scheduler has died", itemID);
                return(null);
            }

            StateDataRequest req = new StateDataRequest(itemID, true);

            req.DisableScriptReason = stopScriptReason;

            _exeScheduler.RequestStateData(req);
            bool success = req.WaitForData(STATE_REQUEST_TIMEOUT);

            if (req.SerializedStateData != null)
            {
                return(req.SerializedStateData);
            }
            else
            {
                _log.ErrorFormat("[Phlox]: Unable to retrieve state data for {0}, timeout: {1}", itemID,
                                 !success);

                return(null);
            }
        }
示例#2
0
        public ScriptRuntimeInformation GetScriptInformation(UUID itemId)
        {
            if (!_masterScheduler.IsRunning)
            {
                _log.ErrorFormat("[Phlox]: Unable to retrieve state data for {0} master scheduler has died", itemId);
                return(null);
            }

            StateDataRequest req = new StateDataRequest(itemId, false);

            req.DisableScriptReason = StopScriptReason.None;

            _exeScheduler.RequestStateData(req);
            bool success = req.WaitForData(STATE_REQUEST_TIMEOUT);

            if (!success)
            {
                return(null);
            }

            Serialization.SerializedRuntimeState state = (Serialization.SerializedRuntimeState)req.RawStateData;

            ScriptRuntimeInformation info = new ScriptRuntimeInformation
            {
                CurrentEvent           = state.RunningEvent == null ? "none" : state.RunningEvent.EventType.ToString(),
                CurrentState           = state.RunState.ToString() + " | GlobalEnable: " + state.Enabled + " | " + req.CurrentLocalEnableState.ToString(),
                MemoryUsed             = state.MemInfo.MemoryUsed,
                TotalRuntime           = state.TotalRuntime,
                NextWakeup             = state.NextWakeup,
                StackFrameFunctionName = state.TopFrame == null ? "none" : state.TopFrame.FunctionInfo.Name,
                TimerInterval          = state.TimerInterval,
                TimerLastScheduledOn   = state.TimerLastScheduledOn
            };

            return(info);
        }
示例#3
0
        public ScriptRuntimeInformation GetScriptInformation(UUID itemId)
        {
            if (!_masterScheduler.IsRunning)
            {
                _log.ErrorFormat("[Phlox]: Unable to retrieve state data for {0} master scheduler has died", itemId);
                return null;
            }

            StateDataRequest req = new StateDataRequest(itemId, false);
            req.DisableScriptReason = StopScriptReason.None;

            _exeScheduler.RequestStateData(req);
            bool success = req.WaitForData(STATE_REQUEST_TIMEOUT);

            if (!success) return null;

            Serialization.SerializedRuntimeState state = (Serialization.SerializedRuntimeState)req.RawStateData;

            ScriptRuntimeInformation info = new ScriptRuntimeInformation
            {
                CurrentEvent = state.RunningEvent == null ? "none" : state.RunningEvent.EventType.ToString(),
                CurrentState = state.RunState.ToString() + " | GlobalEnable: " + state.Enabled + " | " + req.CurrentLocalEnableState.ToString(),
                MemoryUsed = state.MemInfo.MemoryUsed,
                TotalRuntime = state.TotalRuntime,
                NextWakeup = state.NextWakeup,
                StackFrameFunctionName = state.TopFrame == null ? "none" : state.TopFrame.FunctionInfo.Name,
                TimerInterval = state.TimerInterval,
                TimerLastScheduledOn = state.TimerLastScheduledOn
            };

            return info;
        }
示例#4
0
        public byte[] GetBinaryStateSnapshot(OpenMetaverse.UUID itemID, StopScriptReason stopScriptReason)
        {
            if (!_masterScheduler.IsRunning)
            {
                _log.ErrorFormat("[Phlox]: Unable to retrieve state data for {0} master scheduler has died", itemID);
                return null;
            }

            StateDataRequest req = new StateDataRequest(itemID, true);
            req.DisableScriptReason = stopScriptReason;

            _exeScheduler.RequestStateData(req);
            bool success = req.WaitForData(STATE_REQUEST_TIMEOUT);

            if (req.SerializedStateData != null)
            {
                return req.SerializedStateData;
            }
            else
            {
                _log.ErrorFormat("[Phlox]: Unable to retrieve state data for {0}, timeout: {1}", itemID,
                    !success);

                return null;
            }
        }