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); } }
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); }
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; }
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; } }