Add container ignore system

This commit is contained in:
Dev 2023-09-08 15:35:19 +01:00
parent fa68bd7635
commit fbe5af24ee
3 changed files with 16 additions and 2 deletions

View File

@ -48,5 +48,8 @@
},
"writerConfig": {
"outputLocation": "E:\\spt\\dumps\\output"
},
"containerIgnoreList": {
"tarkovstreets": ["container_City_SW_04_DesignStuff_00002"]
}
}

View File

@ -49,4 +49,8 @@ public class Config
[JsonProperty("writerConfig")]
[JsonPropertyName("writerConfig")]
public WriterConfig WriterConfig { get; set; }
[JsonProperty("containerIgnoreList")]
[JsonPropertyName("containerIgnoreList")]
public Dictionary<string, string[]> ContainerIgnoreList { get; set; }
}

View File

@ -88,10 +88,17 @@ public class MultithreadSteppedDumpProcessor : IDumpProcessor
mapDumpCounter.Add(data.Data.Name, 1);
}
LootDumpProcessorContext.GetConfig().ContainerIgnoreList.TryGetValue(data.Data.Id.ToLower(), out string[]? ignoreListForMap);
foreach (var dynamicStaticContainer in StaticLootProcessor.CreateDynamicStaticContainers(data))
{
lock (mapStaticContainersAggregatedLock)
{
// Skip adding containers to aggredated data if container id is in ignore list
if (ignoreListForMap != null && ignoreListForMap.Contains(dynamicStaticContainer.Id))
{
continue;
}
if (mapAggregatedData.ContainsKey(dynamicStaticContainer))
mapAggregatedData[dynamicStaticContainer] += 1;
else