2023-08-12 19:08:38 +01:00
|
|
|
using LootDumpProcessor.Process;
|
2025-01-11 06:54:59 +03:00
|
|
|
using LootDumpProcessor.Process.Processor.DumpProcessor;
|
|
|
|
using LootDumpProcessor.Process.Processor.FileProcessor;
|
|
|
|
using LootDumpProcessor.Process.Processor.v2.AmmoProcessor;
|
|
|
|
using LootDumpProcessor.Process.Processor.v2.StaticContainersProcessor;
|
|
|
|
using LootDumpProcessor.Process.Processor.v2.StaticLootProcessor;
|
2023-08-12 19:08:38 +01:00
|
|
|
using LootDumpProcessor.Storage;
|
2025-01-11 06:54:59 +03:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using LoggerFactory = LootDumpProcessor.Logger.LoggerFactory;
|
2023-08-12 19:08:38 +01:00
|
|
|
|
|
|
|
namespace LootDumpProcessor;
|
|
|
|
|
2024-04-16 18:29:40 +00:00
|
|
|
public static class Program
|
2023-08-12 19:08:38 +01:00
|
|
|
{
|
2025-01-11 06:54:59 +03:00
|
|
|
public static async Task Main()
|
2023-08-12 19:08:38 +01:00
|
|
|
{
|
2025-01-11 06:54:59 +03:00
|
|
|
var services = new ServiceCollection();
|
|
|
|
|
|
|
|
services.AddLogging(configure => configure.AddConsole());
|
|
|
|
services.AddTransient<IStaticLootProcessor, StaticLootProcessor>();
|
|
|
|
services.AddTransient<IStaticContainersProcessor, StaticContainersProcessor>();
|
|
|
|
services.AddTransient<IAmmoProcessor, AmmoProcessor>();
|
|
|
|
services.AddTransient<StaticLootProcessor>();
|
|
|
|
|
|
|
|
services.AddTransient<IFileProcessor, FileProcessor>();
|
|
|
|
services.AddTransient<IDumpProcessor, MultithreadSteppedDumpProcessor>();
|
|
|
|
services.AddTransient<IPipeline, QueuePipeline>();
|
|
|
|
|
|
|
|
await using var serviceProvider = services.BuildServiceProvider();
|
|
|
|
|
2023-08-12 19:08:38 +01:00
|
|
|
// Bootstrap the config before anything else, its required by the whole application to work
|
|
|
|
LootDumpProcessorContext.GetConfig();
|
|
|
|
// Some loggers may need a startup and stop mechanism
|
|
|
|
LoggerFactory.GetInstance().Setup();
|
|
|
|
// Setup Data storage
|
|
|
|
DataStorageFactory.GetInstance().Setup();
|
|
|
|
// startup the pipeline
|
2025-01-11 06:54:59 +03:00
|
|
|
var pipeline = serviceProvider.GetRequiredService<IPipeline>();
|
|
|
|
pipeline.DoProcess();
|
2023-08-12 19:08:38 +01:00
|
|
|
// stop loggers at the end
|
|
|
|
LoggerFactory.GetInstance().Stop();
|
|
|
|
Thread.Sleep(10000);
|
|
|
|
}
|
|
|
|
}
|