BotGenerator/Generator/Program.cs

96 lines
2.5 KiB
C#
Raw Normal View History

2023-09-18 17:15:30 +01:00
using Common.Models.Input;
using Common.Models.Output;
2023-09-18 17:15:30 +01:00
using Generator.Helpers;
using System.Diagnostics;
2023-08-21 16:32:20 +01:00
namespace Generator;
2021-08-12 16:52:06 +01:00
internal static class Program
2021-08-12 16:52:06 +01:00
{
internal static async Task Main(string[] args)
2021-08-12 16:52:06 +01:00
{
var stopwatch = Stopwatch.StartNew();
LoggingHelpers.LogToConsole("Started processing bots");
// Create list of bots we want to process
string[] botTypes = {
"assault",
2024-05-15 11:39:36 +01:00
"assaultgroup",
"marksman",
"pmcbot",
"exusec",
2023-12-28 09:12:54 +00:00
"bossbully",
"bossgluhar",
"bosskilla",
"bosskojaniy",
"bosssanitar",
"bosstagilla",
"bossknight",
"bosszryachiy",
"bossboar",
"bossboarsniper",
"bosskolontay",
2024-08-21 11:51:27 +01:00
"bosspartisan",
"followerbully",
"followergluharassault",
"followergluharscout",
"followergluharsecurity",
"followergluharsnipe",
"followerkojaniy",
"followersanitar",
"followerstormtrooper",
"followerbirdeye",
"followerbigpipe",
"followerzryachiy",
"followerboar",
2023-12-28 09:12:54 +00:00
"followerboarclose1",
"followerboarclose2",
"followerkolontayassault",
"followerkolontaysecurity",
"ravangezryachiyevent",
"peacefullzryachiyevent",
"cursedassault",
"sectantpriest",
"sectantwarrior",
"gifter",
"arenafighterevent",
"crazyassaultevent",
2024-01-01 20:29:58 +00:00
2024-04-04 11:06:52 +01:00
"shooterbtr",
"spiritspring",
2024-05-15 11:39:36 +01:00
"spiritwinter",
"skier",
"peacemaker",
"infectedassault",
"infectedpmc",
"infectedcivil",
"infectedlaborant",
"infectedtagilla",
};
2021-08-12 16:52:06 +01:00
// Read raw bot dumps and turn into c# objects
var workingPath = Directory.GetCurrentDirectory();
var dumpPath = $"{workingPath}//dumps";
List<Bot> bots = BotParser.Parse(dumpPath, botTypes.ToHashSet());
if (bots.Count == 0)
{
LoggingHelpers.LogToConsole("No bots found, unable to continue");
LoggingHelpers.LogToConsole("Check your dumps are in 'Generator\\bin\\Debug\\net6.0\\dumps' and start with 'resp.' NOT 'req.'");
return;
}
2021-08-12 22:26:25 +01:00
var jsonWriter = new JsonWriter(workingPath, "output");
jsonWriter.WriteJson(bots);
stopwatch.Stop();
LoggingHelpers.LogToConsole($"Finished processing bots. Took {LoggingHelpers.LogTimeTaken(stopwatch.Elapsed.TotalSeconds)} seconds");
2021-08-12 16:52:06 +01:00
}
}