// // This is called once every main loop frame, outside of object context // public static void OnMainLoop(ulong frame) { OnScriptContextBegin?.Invoke(); try { using (new Profiler($"{nameof(Entrypoints)}:TaskRunner")) { _taskRunner.Process(); } using (new Profiler($"{nameof(Entrypoints)}:Scheduler.Process()")) { Scheduler.Process(); } } catch (Exception ex) { Log.Write(LogGroup.Error, ex.ToMessageAndCompleteStacktrace()); } OnScriptContextEnd?.Invoke(); }
public int OnRunScript(string script, uint oidSelf) { ScriptHandleResult result = ScriptHandleResult.NotHandled; OnScriptContextBegin?.Invoke(); try { foreach (IScriptDispatcher dispatcher in dispatchers) { result = dispatcher.ExecuteScript(script, oidSelf); if (result != ScriptHandleResult.NotHandled) { break; } } } finally { OnScriptContextEnd?.Invoke(); } return((int)result); }