public void OnUpdate(UpdateEvent ev) { if (fiveSecTimer <= DateTime.Now) { AdminToolbox.CheckJailedPlayers(); fiveSecTimer = DateTime.Now.AddSeconds(5); } if (threeMinTimer <= DateTime.Now) { AdminToolbox.AdminToolboxLogger.PlayerStatsFileManager(null, LogHandlers.PlayerFile.Write); threeMinTimer = DateTime.Now.AddMinutes(3); } if (fiveMinTimer <= DateTime.Now) { fiveMinTimer = DateTime.Now.AddMinutes(5); List <string> playerSteamIds = new List <string>(), keysToRemove = new List <string>(); if (PluginManager.Manager.Server.GetPlayers().Count > 0) { PluginManager.Manager.Server.GetPlayers().ForEach(p => { if (!string.IsNullOrEmpty(p.SteamId)) { playerSteamIds.Add(p.SteamId); } }); } if (AdminToolbox.playerdict.Count > 0 && playerSteamIds.Count > 0) { foreach (KeyValuePair <string, AdminToolbox.AdminToolboxPlayerSettings> kp in AdminToolbox.playerdict) { if (!playerSteamIds.Contains(kp.Key) && !kp.Value.keepSettings) { keysToRemove.Add(kp.Key); } } } if (keysToRemove.Count > 0) { foreach (string key in keysToRemove) { AdminToolbox.playerdict.Remove(key); } } } }