public TimedEvent Timer1(int timeoutDelay, Dictionary <string, object> args) { TimedEvent timedEvent = new TimedEvent(timeoutDelay); timedEvent.Args = args; timedEvent.OnFire += CallBack; return(timedEvent); }
public void CallBack(TimedEvent e) { var dict = e.Args; e.Kill(); Fougerite.Player pl = (Fougerite.Player)dict["player"]; Fougerite.Entity ent = (Fougerite.Entity)dict["entity"]; try { ent.Destroy(); } catch (Exception exc) { Logger.Log(Name + " ERROR: Failed to destroy " + ent.Name + " at position " + ent.Location.ToString()); Logger.Log(Name + exc.ToString()); } if (pl.IsAlive && !pl.IsDisconnecting) { pl.Message("Your " + green + ent.Name + white + " has been removed for exceeding the maximum time allowed"); } }