Dont add bot types we're not interested in
This commit is contained in:
parent
c580c0dec7
commit
9110fabfcf
@ -13,7 +13,7 @@ public static class BotParser
|
|||||||
{
|
{
|
||||||
static JsonSerializerOptions serialiserOptions = new JsonSerializerOptions { };
|
static JsonSerializerOptions serialiserOptions = new JsonSerializerOptions { };
|
||||||
|
|
||||||
public static async Task<List<Datum>> ParseAsync(string dumpPath)
|
public static async Task<List<Datum>> ParseAsync(string dumpPath, string[] botTypes)
|
||||||
{
|
{
|
||||||
var stopwatch = Stopwatch.StartNew();
|
var stopwatch = Stopwatch.StartNew();
|
||||||
|
|
||||||
@ -63,12 +63,18 @@ public static class BotParser
|
|||||||
Console.WriteLine($"parsing: {bots.Count} bots in file {splitFilePath.Last()}");
|
Console.WriteLine($"parsing: {bots.Count} bots in file {splitFilePath.Last()}");
|
||||||
foreach (var bot in bots)
|
foreach (var bot in bots)
|
||||||
{
|
{
|
||||||
|
if (!botTypes.Contains(bot.Info.Settings.Role.ToLower()))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!parsedBotsDict.ContainsKey(bot._id))
|
if (!parsedBotsDict.ContainsKey(bot._id))
|
||||||
{
|
{
|
||||||
parsedBotsDict.Add(bot._id, bot);
|
parsedBotsDict.Add(bot._id, bot);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
var existingBot = parsedBotsDict[bot._id];
|
||||||
dupeCount++;
|
dupeCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ internal static class Program
|
|||||||
// Read raw bot dumps and turn into c# objects
|
// Read raw bot dumps and turn into c# objects
|
||||||
var workingPath = Directory.GetCurrentDirectory();
|
var workingPath = Directory.GetCurrentDirectory();
|
||||||
var dumpPath = $"{workingPath}//dumps";
|
var dumpPath = $"{workingPath}//dumps";
|
||||||
var parsedBots = await BotParser.ParseAsync(dumpPath);
|
var parsedBots = await BotParser.ParseAsync(dumpPath, botTypes);
|
||||||
|
|
||||||
if (parsedBots.Count == 0)
|
if (parsedBots.Count == 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user