public void Validate() { Host = string.IsNullOrWhiteSpace(Host) ? DEFAULT_HOST : Host.Trim(); Port = Math.Min(Math.Max(Port, (ushort)1), ushort.MaxValue); GameFont = string.IsNullOrWhiteSpace(GameFont) ? DEFAULT_FONT : GameFont.Trim(); UIFont = string.IsNullOrWhiteSpace(UIFont) ? DEFAULT_UI_FONT : UIFont.Trim(); ChatLines = Math.Min(Math.Max(ChatLines, 10), 500); IntroImages = new List <string>(IntroImages?.Distinct() ?? new List <string>()); }