示例#1
0
        public void CycleTick()
        {
            if (this.CanScript)
            {
                if (Server.Time > this._second_timer)
                {
                    this._second_timer = Server.Time;
                    JSScript[] scripts = ScriptManager.Scripts.ToArray();

                    foreach (JSScript s in scripts)
                    {
                        try
                        {
                            s.JS.CallGlobalFunction("onTimer");
                        }
                        catch (Jurassic.JavaScriptException e)
                        {
                            ErrorDispatcher.SendError(s.ScriptName, e.Message, e.LineNumber);
                        }
                        catch { }
                    }
                }

                ScriptManager.DequeueCallbacks();
                TimerList.UpdateTimers();
                LiveScript.CheckTasks();
            }
        }