public JsonResult SelfTest() { var mpqFiles = MPQTriangleSupplier.GetArchiveNames(DataConfig.Load(), s => logger.WriteLine(s)); var countOfMPQFiles = mpqFiles.Where(f => System.IO.File.Exists(f)).Count(); if (countOfMPQFiles == 0) { logger.WriteLine("Some of these MPQ files should exist!"); mpqFiles.ToList().ForEach(l => logger.WriteLine(l)); logger.WriteLine("No MPQ files found, refer to the Readme to download them."); } else { logger.WriteLine("MPQ files exist."); } return(new JsonResult(countOfMPQFiles > 0)); }
public bool SelfTest() { var mpqFiles = MPQTriangleSupplier.GetArchiveNames(s => logger.LogInformation(s)); var countOfMPQFiles = mpqFiles.Where(f => File.Exists(f)).Count(); if (countOfMPQFiles == 0) { logger.LogWarning("Some of these MPQ files should exist!"); mpqFiles.ToList().ForEach(l => logger.LogInformation(l)); logger.LogError("No MPQ files found, refer to the Readme to download them."); Enabled = false; } else { logger.LogDebug("Hooray, MPQ files exist."); } return(countOfMPQFiles > 0); }