/// <summary> /// Queues an event if the event queue is below the maximum size /// </summary> /// <param name="postedEvent"></param> public void QueueEvent(PostedEvent postedEvent) { if (EventQueue.Count < MAX_EVENT_QUEUE_SIZE || AllowOverflow(postedEvent)) { EventQueue.Enqueue(postedEvent); } }
/// <summary> /// Resets the runtime state of this script putting IP back /// at the init state and clearing out the call and operand stack /// </summary> public void Reset() { MemInfo.MemoryUsed = 0; RunState = Status.Running; GeneralEnable = true; IP = 0; LSLState = 0; TopFrame = null; Calls.Clear(); Operands.Clear(); EventQueue.Clear(); NextWakeup = 0; StateCapturedOn = 0; TimerLastScheduledOn = 0; TimerInterval = 0; RunningEvent = null; PermsGranter = String.Empty; GrantedPermsMask = 0; ActiveListens.Clear(); StartParameter = 0; //null out all globals for (int i = 0; i < Globals.Length; i++) { Globals[i] = null; } this.ResetRuntime(); }
private bool AllowOverflow(PostedEvent postedEvent) { if (OVERFLOWABLE_EVENTS.Contains(postedEvent.EventType)) { return(true); } return(false); }
/// <summary> /// Pushes the given args onto the stack and positions the function pointer /// </summary> /// <param name="info"></param> /// <param name="args"></param> public void DoEvent(EventInfo info, PostedEvent triggeringEvent, IList <object> args) { TopFrame = new StackFrame(info.ToFunctionInfo(), 0); Calls.Push(TopFrame); IP = info.Address; Debug.Assert(args.Count == info.NumberOfArguments); for (int i = 0; i < args.Count; i++) { TopFrame.Locals[i] = args[i]; } RunState = Status.Running; RunningEvent = triggeringEvent; MemInfo.AddCall(TopFrame); }
private bool AllowOverflow(PostedEvent postedEvent) { if (OVERFLOWABLE_EVENTS.Contains(postedEvent.EventType)) { return true; } return false; }
/// <summary> /// Pushes the given args onto the stack and positions the function pointer /// </summary> /// <param name="info"></param> /// <param name="args"></param> public void DoEvent(EventInfo info, PostedEvent triggeringEvent, IList<object> args) { TopFrame = new StackFrame(info.ToFunctionInfo(), 0); Calls.Push(TopFrame); IP = info.Address; Debug.Assert(args.Count == info.NumberOfArguments); for (int i = 0; i < args.Count; i++) { TopFrame.Locals[i] = args[i]; } RunState = Status.Running; RunningEvent = triggeringEvent; MemInfo.AddCall(TopFrame); }