From 3b99fc190ba7023fdacc24e0e4b8f9f0ff5968b9 Mon Sep 17 00:00:00 2001 From: Dev Date: Sun, 13 Aug 2023 18:59:22 +0100 Subject: [PATCH] Remove unnecessary code --- LootDumpProcessorContext.cs | 3 +-- .../DumpProcessor/MultithreadSteppedDumpProcessor.cs | 11 +---------- Process/TarkovItems.cs | 9 +-------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/LootDumpProcessorContext.cs b/LootDumpProcessorContext.cs index 3db2ce0..47cb433 100644 --- a/LootDumpProcessorContext.cs +++ b/LootDumpProcessorContext.cs @@ -117,8 +117,7 @@ public class LootDumpProcessorContext { _tarkovItems = new TarkovItems( $"{GetConfig().ServerLocation}/project/assets/database/templates/items.json", - $"{GetConfig().ServerLocation}/project/assets/database/templates/handbook.json", - $"{GetConfig().ServerLocation}/project/assets/database/locations/tarkovstreets/statics.json" + $"{GetConfig().ServerLocation}/project/assets/database/templates/handbook.json" ); } } diff --git a/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs b/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs index 11e7a50..3e5d96c 100644 --- a/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs +++ b/Process/Processor/DumpProcessor/MultithreadSteppedDumpProcessor.cs @@ -144,16 +144,7 @@ public class MultithreadSteppedDumpProcessor : IDumpProcessor } private static double GetStaticProbability(string mapName, KeyValuePair td, Dictionary mapDumpCounter) - { - if (mapName == "Streets of Tarkov") - { - var result = LootDumpProcessorContext.GetTarkovItems().GetProbabilityByContainerId(td.Key.Id); - if (result != null) - { - return Math.Round((double)(result.probability), 2); - } - } - + { return Math.Round((double)((decimal)td.Value / (decimal)mapDumpCounter[mapName]), 2); } diff --git a/Process/TarkovItems.cs b/Process/TarkovItems.cs index 9857d39..a818fb1 100644 --- a/Process/TarkovItems.cs +++ b/Process/TarkovItems.cs @@ -9,13 +9,11 @@ public class TarkovItems private Dictionary _items; private HandbookRoot _handbook; - private List _streetsStatics; - public TarkovItems(string items, string handbook, string streetsStatics) + public TarkovItems(string items, string handbook) { _items = _jsonSerializer.Deserialize>(File.ReadAllText(items)); _handbook = _jsonSerializer.Deserialize(File.ReadAllText(handbook)); - _streetsStatics = _jsonSerializer.Deserialize>(File.ReadAllText(streetsStatics)); } public virtual bool IsBaseClass(string tpl, string baseclass_id) @@ -44,9 +42,4 @@ public class TarkovItems var item_template = _items[tpl]; return item_template.Props.Caliber; } - - public virtual StaticContainerRoot GetProbabilityByContainerId(string id) - { - return _streetsStatics.FirstOrDefault(x => x.template.Id == id); - } } \ No newline at end of file