Esempio n. 1
0
 public string GetErrorsString()
 {
     return("Type\tBaseType\tName" + Environment.NewLine +
            string.Join(Environment.NewLine,
                        UniquesErrors.Select(e => "Unique\t" + e.BaseType + "\t" + e.Name)
                        .Concat(EnchantsErrors.Select(e => "Enchants\t" + e.BaseType + "\t" + e.Name))));
 }
Esempio n. 2
0
        private void UniqueJsonHandler(ItemData jdata, LeagueData data)
        {
            string baseTy = jdata.BaseType;

            if (!data.Uniques.TryGetValue(baseTy, out UniqueBaseType uniq))
            {
                uniq = new UniqueBaseType(baseTy);
                data.Uniques.Add(baseTy, uniq);
            }
            if (!uniq.Add(jdata))
            {
                UniquesErrors.Add(jdata);
            }
        }
Esempio n. 3
0
        public void Load()
        {
            LoadUniquesCsv();
            LoadEnchantsCsv();
            UniquesErrors.Clear();
            EnchantsErrors.Clear();
            GetJsonData(HC);
            GetJsonData(SC);
            string filterString = Util.ReadWebPage(FiltersUrl + filterFile);

            if (filterString.Length == 0)
            {
                MessageBox.Show("Failed to read the web URL: " + FiltersUrl + filterFile, "Error", MessageBoxButtons.OK);
                Environment.Exit(1);
            }
            Load(filterString.Split('\n'));

            Match m = versionRegex.Match(filterString);

            VersionMajor   = int.Parse(m.Groups[1].Value);
            VersionMinor   = int.Parse(m.Groups[2].Value);
            VersionRelease = int.Parse(m.Groups[3].Value);
            Version        = VersionMajor.ToString() + "." + VersionMinor + "." + VersionRelease;

            if (UniquesErrors.Count > 0 || EnchantsErrors.Count > 0)
            {
                UniquesErrors  = UniquesErrors.Distinct().OrderBy(x => x.BaseType).ThenBy(x => x.Name).ToList();
                EnchantsErrors = EnchantsErrors.Distinct().OrderBy(x => x.BaseType).ThenBy(x => x.Name).ToList();
                List <string> errs = new List <string>();
                if (UniquesErrors.Count > 0)
                {
                    errs.Add(UniquesErrors.Count + " uniques");
                }
                if (EnchantsErrors.Count > 0)
                {
                    errs.Add(EnchantsErrors.Count + " enchantments");
                }
                MessageBox.Show("Missing " + string.Join(", ", errs) + "\n\nThese will be copied to the clipboard. Add them to the CSV files.", "Load JSON", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }