예제 #1
0
        public JintTE CreateParallelTimer(string name, int timeoutDelay, Dictionary <string, object> args)
        {
            JintTE timedEvent = new JintTE(name, (double)timeoutDelay);

            timedEvent.Args    = args;
            timedEvent.OnFire += new JintTE.TimedEventFireDelegate(Plugin.OnTimerCB2);
            ParallelTimers.Add(timedEvent);
            return(timedEvent);
        }
예제 #2
0
 public void OnTimerCB2(JintTE evt)
 {
     try
     {
         Invoke(evt.Name + "Callback", evt);
     }
     catch (Exception ex)
     {
         Fougerite.Logger.LogError("Failed to invoke callback " + evt.Name + " Ex: " + ex);
     }
 }
예제 #3
0
        public void KillTimer(string name)
        {
            JintTE timer = GetTimer(name);

            if (timer == null)
            {
                return;
            }

            timer.Kill();
            Timers.Remove(name);
        }
예제 #4
0
        public JintTE CreateTimer(string name, int timeoutDelay)
        {
            JintTE timedEvent = GetTimer(name);

            if (timedEvent == null)
            {
                timedEvent         = new JintTE(name, (double)timeoutDelay);
                timedEvent.OnFire += new JintTE.TimedEventFireDelegate(Plugin.OnTimerCB2);
                Timers.Add(name, timedEvent);
            }
            return(timedEvent);
        }