From 8d9f96600b88b2fbd7c660876ce5d8b560d70b79 Mon Sep 17 00:00:00 2001 From: CWX Date: Mon, 24 Feb 2025 17:27:31 +0000 Subject: [PATCH] Trader is a KVP, changed naming and fixed kvp.tostring being added to "traderId" --- Libraries/Core/Services/InsuranceService.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Libraries/Core/Services/InsuranceService.cs b/Libraries/Core/Services/InsuranceService.cs index aa0d0008..e73d1282 100644 --- a/Libraries/Core/Services/InsuranceService.cs +++ b/Libraries/Core/Services/InsuranceService.cs @@ -74,28 +74,28 @@ public class InsuranceService( { // Get insurance items for each trader var globals = _databaseService.GetGlobals(); - foreach (var trader in GetInsurance(sessionID)) + foreach (var traderKvP in GetInsurance(sessionID)) { - var traderEnum = _traderHelper.GetTraderById(trader.Key); + var traderEnum = _traderHelper.GetTraderById(traderKvP.Key); if (traderEnum is null) { - _logger.Error(_localisationService.GetText("insurance-trader_missing_from_enum", trader.Key)); + _logger.Error(_localisationService.GetText("insurance-trader_missing_from_enum", traderKvP.Key)); continue; } - var traderBase = _traderHelper.GetTrader(trader.Key, sessionID); + var traderBase = _traderHelper.GetTrader(traderKvP.Key, sessionID); if (traderBase is null) { - _logger.Error(_localisationService.GetText("insurance-unable_to_find_trader_by_id", trader.Key)); + _logger.Error(_localisationService.GetText("insurance-unable_to_find_trader_by_id", traderKvP.Key)); continue; } - var dialogueTemplates = _databaseService.GetTrader(trader.Key).Dialogue; + var dialogueTemplates = _databaseService.GetTrader(traderKvP.Key).Dialogue; if (dialogueTemplates is null) { - _logger.Error(_localisationService.GetText("insurance-trader_lacks_dialogue_property", trader.Key)); + _logger.Error(_localisationService.GetText("insurance-trader_lacks_dialogue_property", traderKvP.Key)); continue; } @@ -125,12 +125,12 @@ public class InsuranceService( new Insurance { ScheduledTime = (int) GetInsuranceReturnTimestamp(pmcData, traderBase), - TraderId = trader.ToString(), + TraderId = traderKvP.Key, MaxStorageTime = (int) GetMaxInsuranceStorageTime(traderBase), SystemData = systemData, MessageType = MessageType.INSURANCE_RETURN, MessageTemplateId = _randomUtil.GetArrayValue(dialogueTemplates["insuranceFound"]), - Items = GetInsurance(sessionID)[trader.Key] + Items = GetInsurance(sessionID)[traderKvP.Key] } ); }