public static void CheckExpiredEntries() { for (int i = GreetingsEntries.Count - 1; i >= 0; i--) { if (GreetingsEntries[i].Expires != DateTime.MinValue && GreetingsEntries[i].Expired) { GreetingsEntries.RemoveAt(i); } } for (int i = ModeratorEntries.Count - 1; i >= 0; i--) { if (ModeratorEntries[i].Expired) { ModeratorEntries.RemoveAt(i); } } for (int i = CityEntries.Count - 1; i >= 0; i--) { if (CityEntries[i].Expired) { CityEntries.RemoveAt(i); } } for (int i = GuildEntries.Count - 1; i >= 0; i--) { if (GuildEntries[i].Expired) { GuildEntries.RemoveAt(i); } } if (MysteriousPotionEffects != null) { List <Mobile> list = new List <Mobile>(MysteriousPotionEffects.Keys); for (var index = 0; index < list.Count; index++) { Mobile m = list[index]; if (MysteriousPotionEffects != null && MysteriousPotionEffects.ContainsKey(m) && MysteriousPotionEffects[m] < DateTime.UtcNow) { MysteriousPotionEffects.Remove(m); if (MysteriousPotionEffects.Count == 0) { MysteriousPotionEffects = null; } } } ColUtility.Free(list); } CheckTimer(); }
public static void CheckExpiredEntries() { for (int i = ModeratorEntries.Count - 1; i >= 0; i--) { if (ModeratorEntries[i].Expired) { ModeratorEntries.RemoveAt(i); } } for (int i = CityEntries.Count - 1; i >= 0; i--) { if (CityEntries[i].Expired) { CityEntries.RemoveAt(i); } } for (int i = GuildEntries.Count - 1; i >= 0; i--) { if (GuildEntries[i].Expired) { GuildEntries.RemoveAt(i); } } if (MysteriousPotionEffects != null) { var list = new List <Mobile>(MysteriousPotionEffects.Keys); foreach (var m in list) { if (MysteriousPotionEffects != null && MysteriousPotionEffects.ContainsKey(m) && MysteriousPotionEffects[m] < DateTime.UtcNow) { MysteriousPotionEffects.Remove(m); if (MysteriousPotionEffects.Count == 0) { MysteriousPotionEffects = null; } } } ColUtility.Free(list); } CheckTimer(); }