2023-09-18 17:15:30 +01:00
|
|
|
|
using Common.Models.Input;
|
|
|
|
|
using Generator.Helpers;
|
2023-08-21 16:32:20 +01:00
|
|
|
|
|
|
|
|
|
namespace Generator;
|
2021-08-12 16:52:06 +01:00
|
|
|
|
|
2021-11-26 14:50:07 +00:00
|
|
|
|
internal static class Program
|
2021-08-12 16:52:06 +01:00
|
|
|
|
{
|
2021-11-26 14:50:07 +00:00
|
|
|
|
internal static async Task Main(string[] args)
|
2021-08-12 16:52:06 +01:00
|
|
|
|
{
|
2021-11-26 14:50:07 +00:00
|
|
|
|
// Create list of bots we want to process
|
|
|
|
|
string[] botTypes = {
|
2023-08-15 09:29:16 +00:00
|
|
|
|
"assault",
|
2024-02-21 17:06:08 +00:00
|
|
|
|
"marksman",
|
|
|
|
|
"pmcbot",
|
|
|
|
|
"exusec",
|
2023-12-28 09:12:54 +00:00
|
|
|
|
|
2024-02-21 17:06:08 +00:00
|
|
|
|
"bossbully",
|
|
|
|
|
"bossgluhar",
|
|
|
|
|
"bosskilla",
|
|
|
|
|
"bosskojaniy",
|
|
|
|
|
"bosssanitar",
|
|
|
|
|
"bosstagilla",
|
|
|
|
|
"bossknight",
|
|
|
|
|
"bosszryachiy",
|
|
|
|
|
"bossboar",
|
|
|
|
|
"bossboarsniper",
|
|
|
|
|
"bosskolontay",
|
2023-10-31 19:35:32 +00:00
|
|
|
|
|
2024-02-21 17:06:08 +00:00
|
|
|
|
"followerbully",
|
|
|
|
|
"followergluharassault",
|
|
|
|
|
"followergluharscout",
|
|
|
|
|
"followergluharsecurity",
|
|
|
|
|
"followergluharsnipe",
|
|
|
|
|
"followerkojaniy",
|
|
|
|
|
"followersanitar",
|
|
|
|
|
"followerstormtrooper",
|
|
|
|
|
"followerbirdeye",
|
|
|
|
|
"followerbigpipe",
|
2023-08-15 09:29:16 +00:00
|
|
|
|
"followerzryachiy",
|
|
|
|
|
"followerboar",
|
2023-12-28 09:12:54 +00:00
|
|
|
|
"followerboarclose1",
|
|
|
|
|
"followerboarclose2",
|
|
|
|
|
"followerkolontayassault",
|
|
|
|
|
"followerkolontaysecurity",
|
2023-10-31 19:35:32 +00:00
|
|
|
|
|
2024-02-21 17:06:08 +00:00
|
|
|
|
"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",
|
|
|
|
|
"spiritwinter"
|
2023-10-31 19:35:32 +00:00
|
|
|
|
};
|
2021-08-12 16:52:06 +01:00
|
|
|
|
|
2021-11-26 14:50:07 +00:00
|
|
|
|
// Read raw bot dumps and turn into c# objects
|
|
|
|
|
var workingPath = Directory.GetCurrentDirectory();
|
|
|
|
|
var dumpPath = $"{workingPath}//dumps";
|
2023-09-18 16:30:24 +01:00
|
|
|
|
var parsedBots = BotParser.ParseAsync(dumpPath, botTypes.ToHashSet());
|
2021-08-12 16:52:06 +01:00
|
|
|
|
|
2023-10-31 19:35:32 +00:00
|
|
|
|
// Put in dictionary for better use later on
|
2024-02-21 17:06:08 +00:00
|
|
|
|
var rawBotsCache = new Dictionary<string, List<Datum>>(45);
|
2023-09-18 17:15:30 +01:00
|
|
|
|
foreach (var rawBot in parsedBots)
|
|
|
|
|
{
|
|
|
|
|
if (rawBotsCache.TryGetValue(rawBot.Info.Settings.Role.ToLower(), out var botList))
|
2023-10-31 19:35:32 +00:00
|
|
|
|
{
|
2023-09-18 17:15:30 +01:00
|
|
|
|
botList.Add(rawBot);
|
2023-10-31 19:35:32 +00:00
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Doesnt exist, add key and bot
|
|
|
|
|
rawBotsCache.Add(rawBot.Info.Settings.Role.ToLower(), new List<Datum> { rawBot });
|
2023-09-18 17:15:30 +01:00
|
|
|
|
}
|
2023-10-31 19:35:32 +00:00
|
|
|
|
|
2021-11-26 14:50:07 +00:00
|
|
|
|
if (parsedBots.Count == 0)
|
|
|
|
|
{
|
2023-10-31 19:35:32 +00:00
|
|
|
|
LoggingHelpers.LogToConsole("No bots found, unable to continue");
|
2023-08-15 09:29:16 +00:00
|
|
|
|
LoggingHelpers.LogToConsole("Check your dumps are in 'Generator\\bin\\Debug\\net6.0\\dumps' and start with 'resp.' NOT 'req.'");
|
2021-11-26 14:50:07 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2021-08-12 22:26:25 +01:00
|
|
|
|
|
2021-11-26 14:50:07 +00:00
|
|
|
|
// Generate the base bot class with basic details (health/body part hp etc) and then append everything else
|
|
|
|
|
var bots = BaseBotGenerator.GenerateBaseDetails(parsedBots, workingPath, botTypes)
|
2023-10-31 19:35:32 +00:00
|
|
|
|
.AddGear(rawBotsCache) // Add weapons/armor
|
|
|
|
|
.AddLoot(rawBotsCache)
|
|
|
|
|
.AddChances(rawBotsCache); // Add mod/equipment chances
|
2021-08-27 21:34:12 +01:00
|
|
|
|
|
2021-11-26 14:50:07 +00:00
|
|
|
|
// Output bot to json file
|
|
|
|
|
var jsonWriter = new JsonWriter(workingPath, "output");
|
|
|
|
|
jsonWriter.WriteJson(bots.ToList());
|
2021-08-12 16:52:06 +01:00
|
|
|
|
}
|
|
|
|
|
}
|