public MagmaTE CreateParallelTimer(string name, int timeoutDelay, Dictionary <string, object> args) { MagmaTE timedEvent = new MagmaTE(name, timeoutDelay, args); timedEvent.OnFire += new MagmaTE.TimedEventFireDelegate(Plugin.OnTimerCB); ParallelTimers.Add(timedEvent); return(timedEvent); }
public void OnTimerCB(MagmaTE evt) { try { Invoke(evt.Name + "Callback", evt); } catch (Exception ex) { Fougerite.Logger.LogError("Failed to invoke callback " + evt.Name + " Ex: " + ex); } }
public void KillTimer(string name) { MagmaTE timer = GetTimer(name); if (timer == null) { return; } timer.Kill(); Timers.Remove(name); }
public MagmaTE CreateTimer(string name, int timeoutDelay) { MagmaTE timedEvent = GetTimer(name); if (timedEvent == null) { timedEvent = new MagmaTE(name, (double)timeoutDelay); timedEvent.OnFire += new MagmaTE.TimedEventFireDelegate(Plugin.OnTimerCB); Timers.Add(name, timedEvent); } return(timedEvent); }