示例#1
0
        public static CfanJson createCfanJsonFromFile(string directoryOrZipFile)
        {
            ModInfoJson modInfo = FactorioModParser.parseMod(directoryOrZipFile);

            if (modInfo == null)
            {
                throw new Exception($"Couldn't parse info.json from '{directoryOrZipFile}'!");
            }
            return(createCfanJsonFromModInfoJson(modInfo, new System.IO.FileInfo(directoryOrZipFile).Length));
        }
示例#2
0
 protected static ModInfoJson parsePotentialMod(string directoryOrZipFile)
 {
     try
     {
         return(FactorioModParser.parseMod(directoryOrZipFile));
     }
     catch (Exception e)
     {
         log.WarnFormat("Couldn't parse potential mod in {0}: {1}", directoryOrZipFile, e.Message);
         log.Debug(e, e);
         return(null);
     }
 }
示例#3
0
 public static ModVersion getModVersion(string path)
 {
     return(FactorioModParser.parseMod(path).version);
 }