public static void MergePreVerToPostVer(string dataPath, string dataSuffix, string searchPath) { DataStore.Initialise(dataPath, dataSuffix); var pm = new PathManager(searchPath); pm.AddExcludePath(DataStore.LosPath); foreach (var f in pm.GetFiles()) { Console.WriteLine(f.FullName); Match match; if ((match = Regex.Match(f.Name, @"^(?<region>[A-Z]+)-match-id-nonexistent\.losmid$")).Success) { var region = EnumStrong.Parse <Region>(match.Groups["region"].Value); DataStore.LosMatchIdsNonExistent[region].AppendItems(new MatchIdContainer(f.FullName, region).ReadItems(), LosChunkFormat.LZ4HC); } else if ((match = Regex.Match(f.Name, @"^(?<region>[A-Z]+)-match-id-existing\.losmid$")).Success) { var region = EnumStrong.Parse <Region>(match.Groups["region"].Value); DataStore.LosMatchIdsExisting[region].AppendItems(new MatchIdContainer(f.FullName, region).ReadItems(), LosChunkFormat.LZ4HC); } else if ((match = Regex.Match(f.Name, @"^(?<region>[A-Z]+)-matches-(?<queueId>\d+)\.losjs$")).Success) { var region = EnumStrong.Parse <Region>(match.Groups["region"].Value); var queueId = int.Parse(match.Groups["queueId"].Value); foreach (var json in new JsonContainer(f.FullName).ReadItems()) { var info = new BasicMatchInfo(json); Ut.Assert(info.QueueId == queueId); DataStore.LosMatchJsons[region][info.GameVersion][info.QueueId].AppendItems(new[] { json }, LosChunkFormat.LZ4); } } } }
private (bool added, bool rangeExpanded) countMatch(BasicMatchInfo info) { bool rangeExpanded = info.MatchId <EarliestMatchId || info.MatchId> LatestMatchId; bool added = false; if ((Versions == null || Versions.Contains(info.GameVersion)) && (QueueId == null || info.QueueId == QueueId)) { MatchCount++; EarliestMatchDate = Math.Min(EarliestMatchDate, info.GameCreation); LatestMatchDate = Math.Max(LatestMatchDate, info.GameCreation); EarliestMatchId = Math.Min(EarliestMatchId, info.MatchId); LatestMatchId = Math.Max(LatestMatchId, info.MatchId); added = true; } return(added, rangeExpanded); }