private static void HandleSuccess(Options o) { if (o.List) { var finder = new ReplayFinder(); var replays = finder.GetReplays(); foreach (Replay item in replays) { Console.WriteLine($"{item.Date:yyyy-MM-dd}\t{item.Mode}\t{item.Region}\t{item.Platform}\t{item.Id}"); } } else { var ps = new PubgSpider(o); Console.WriteLine($"Player\tRank\tKills"); foreach (var playerResult in ps.GetResult()) { Console.WriteLine($"{playerResult.Name}\t{playerResult.Rank}\t{playerResult.Kills}"); } if (ps.WasPlatformReset) { string warning = $"Defaulting platform reset to {o.Platform}."; ConsoleWriteWarning(warning); } } }
private static void HandleInvalid(IEnumerable <Error> obj) { var finder = new ReplayFinder(); var replays = finder.GetReplays(); var lastReplay = replays.LastOrDefault(); if (lastReplay == null) { return; } ConsoleWriteWarning("I use the last replay found in local app data"); var options = new Options() { MatchId = lastReplay.Id.ToString(), Platform = lastReplay.Platform }; HandleSuccess(options); }