public static void Initialize() { if (timer != null) { timer.Dispose(); // dispose the old timer if theres already one } timer = new Timer { AutoReset = true, Interval = 60000 // once per minute }; timer.Elapsed += (x, y) => OneMinuteEvent.Invoke(); timer.Start(); UserManager.OnUserLoggedIn.Remove(OnUserLogin); UserManager.OnUserLoggedIn.Add(OnUserLogin); }
public static void Initialize() { REYmodSettings.OnSendMessageToggleChange.Add(ServerGUIBroadcast); if (timer != null) { timer.Dispose(); // dispose the old timer if theres already one } timer = new Timer { AutoReset = true, Interval = 60000 // once per minute }; timer.Elapsed += (x, y) => OneMinuteEvent.Invoke(); timer.Start(); UserManager.OnUserLoggedIn.Remove(OnUserLogin); UserManager.OnUserLoggedIn.Add(OnUserLogin); }
/// <summary> /// This method is called whenever a player eats somethin /// </summary> /// <param name="food">the eaten fooditem</param> /// <param name="user">the player who ate</param> private static void PlayerEatFood(FoodItem food, User user) { OnPlayerEatFood.Invoke(food, user); //ChatManager.ServerMessageToAllAlreadyLocalized(user.UILink() + " just ate " + food.UILink(), false); }
private void _onSendMessageToggleChange() { OnSendMessageToggleChange.Invoke(); }
private void _onSeedDropChange() { OnSeedDropChange.Invoke(Config.SeedDropMultiplier); }
private void _onPlantYieldChange() { OnPlantYieldChange.Invoke(Config.PlantYieldMultiplier); }