Example #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();
            }
        }
Example #2
0
 public void ServerStarted()
 {
     this._second_timer = 0;
     this.CanScript     = Server.Scripting.ScriptEnabled;
     TimerList.Reset();
     LiveScript.Reset();
     ErrorDispatcher.Reset();
     ScriptManager.AutoRun();
 }
 public void KillScript()
 {
     this.local_users.Clear();
     this.leaves.ForEach(x => x.users.Clear());
     this.leaves.Clear();
     this.JS = null;
     ScriptManager.RemoveCallbacks(this.ScriptName);
     this.timer_idents.Clear();
     TimerList.RemoveScriptTimers(this.ScriptName);
 }