public Timer CreateTimer(double time, StoryEventType eventType, string key) { Timer timer = new Timer(); timer.Elapsed += delegate { NitroxModel.Logger.Log.Info("Triggering event type " + eventType.ToString() + " at time " + time.ToString() + " with param " + key.ToString()); playerManager.SendPacketToAllPlayers(new StoryEventSend(eventType, key)); }; timer.Interval = time; timer.Enabled = true; timer.AutoReset = false; return(timer); }
private Timer CreateTimer(double time, StoryEventType eventType, string key) { //if timeOffset goes past the time if (time <= 0) { return(null); } Timer timer = new Timer(); timer.Elapsed += delegate { Log.Info("Triggering event type " + eventType.ToString() + " at time " + time.ToString() + " with param " + key.ToString()); playerManager.SendPacketToAllPlayers(new StoryEventSend(eventType, key)); }; timer.Interval = time; timer.Enabled = true; timer.AutoReset = false; return(timer); }
public StoryEventSend(StoryEventType storyEventType, string key = "") : base() { UnityEngine.Debug.Log(key + " " + storyEventType.ToString()); this.StoryEventType = storyEventType; this.Key = key; }