Remove I18nService, migrate to renamed ServerLocalisationService (#433)
* Remove I18nService, migrate to renamed ServerLocalisationService * Revert VS fuckup * Update using * Remove unused parameter, update comment * Fix develop branch not building
This commit is contained in:
@@ -15,7 +15,7 @@ public class ClientLogCallbacks(
|
||||
HttpResponseUtil _httpResponseUtil,
|
||||
ClientLogController _clientLogController,
|
||||
ConfigServer _configServer,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
IReadOnlyList<SptMod> _loadedMods
|
||||
)
|
||||
{
|
||||
@@ -38,27 +38,27 @@ public class ClientLogCallbacks(
|
||||
var data = _configServer.GetConfig<CoreConfig>().Release;
|
||||
|
||||
data.BetaDisclaimerText = ProgramStatics.MODS()
|
||||
? _localisationService.GetText("release-beta-disclaimer-mods-enabled")
|
||||
: _localisationService.GetText("release-beta-disclaimer");
|
||||
? _serverLocalisationService.GetText("release-beta-disclaimer-mods-enabled")
|
||||
: _serverLocalisationService.GetText("release-beta-disclaimer");
|
||||
|
||||
data.BetaDisclaimerAcceptText = _localisationService.GetText(
|
||||
data.BetaDisclaimerAcceptText = _serverLocalisationService.GetText(
|
||||
"release-beta-disclaimer-accept"
|
||||
);
|
||||
data.ServerModsLoadedText = _localisationService.GetText("release-server-mods-loaded");
|
||||
data.ServerModsLoadedDebugText = _localisationService.GetText(
|
||||
data.ServerModsLoadedText = _serverLocalisationService.GetText("release-server-mods-loaded");
|
||||
data.ServerModsLoadedDebugText = _serverLocalisationService.GetText(
|
||||
"release-server-mods-debug-message"
|
||||
);
|
||||
data.ClientModsLoadedText = _localisationService.GetText("release-plugins-loaded");
|
||||
data.ClientModsLoadedDebugText = _localisationService.GetText(
|
||||
data.ClientModsLoadedText = _serverLocalisationService.GetText("release-plugins-loaded");
|
||||
data.ClientModsLoadedDebugText = _serverLocalisationService.GetText(
|
||||
"release-plugins-loaded-debug-message"
|
||||
);
|
||||
data.IllegalPluginsLoadedText = _localisationService.GetText(
|
||||
data.IllegalPluginsLoadedText = _serverLocalisationService.GetText(
|
||||
"release-illegal-plugins-loaded"
|
||||
);
|
||||
data.IllegalPluginsExceptionText = _localisationService.GetText(
|
||||
data.IllegalPluginsExceptionText = _serverLocalisationService.GetText(
|
||||
"release-illegal-plugins-exception"
|
||||
);
|
||||
data.ReleaseSummaryText = _localisationService.GetText("release-summary");
|
||||
data.ReleaseSummaryText = _serverLocalisationService.GetText("release-summary");
|
||||
data.IsBeta =
|
||||
ProgramStatics.ENTRY_TYPE() is EntryType.BLEEDING_EDGE or EntryType.BLEEDING_EDGE_MODS;
|
||||
data.IsModdable = ProgramStatics.MODS();
|
||||
|
||||
@@ -28,7 +28,7 @@ public class BotController(
|
||||
BotGenerator _botGenerator,
|
||||
BotHelper _botHelper,
|
||||
BotDifficultyHelper _botDifficultyHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
SeasonalEventService _seasonalEventService,
|
||||
MatchBotDetailsCacheService _matchBotDetailsCacheService,
|
||||
ProfileHelper _profileHelper,
|
||||
@@ -52,7 +52,7 @@ public class BotController(
|
||||
if (!_botConfig.PresetBatch.TryGetValue(type, out var limit))
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("bot-bot_preset_count_value_missing", type)
|
||||
_serverLocalisationService.GetText("bot-bot_preset_count_value_missing", type)
|
||||
);
|
||||
|
||||
return 10;
|
||||
@@ -97,7 +97,7 @@ public class BotController(
|
||||
if (!(raidConfig != null || ignoreRaidSettings))
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-missing_application_context",
|
||||
"RAID_CONFIGURATION"
|
||||
)
|
||||
@@ -354,7 +354,9 @@ public class BotController(
|
||||
if (raidConfiguration is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("bot-unable_to_load_raid_settings_from_appcontext")
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-unable_to_load_raid_settings_from_appcontext"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -429,7 +431,7 @@ public class BotController(
|
||||
if (location == "default")
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-no_bot_cap_found_for_location",
|
||||
location.ToLower()
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ public class BuildController(
|
||||
EventOutputHolder _eventOutputHolder,
|
||||
DatabaseService _databaseService,
|
||||
ProfileHelper _profileHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ItemHelper _itemHelper,
|
||||
SaveServer _saveServer,
|
||||
ICloner _cloner
|
||||
@@ -266,6 +266,8 @@ public class BuildController(
|
||||
}
|
||||
|
||||
// Not found in weapons,equipment or magazines, not good
|
||||
_logger.Error(_localisationService.GetText("build-unable_to_delete_preset", idToRemove));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("build-unable_to_delete_preset", idToRemove)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class CustomizationController(
|
||||
EventOutputHolder _eventOutputHolder,
|
||||
DatabaseService _databaseService,
|
||||
SaveServer _saveServer,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ProfileHelper _profileHelper,
|
||||
ICloner _cloner,
|
||||
PaymentService _paymentService
|
||||
@@ -54,7 +54,7 @@ public class CustomizationController(
|
||||
if (matchingSuits == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText("customisation-unable_to_get_trader_suits", traderId)
|
||||
_serverLocalisationService.GetText("customisation-unable_to_get_trader_suits", traderId)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class CustomizationController(
|
||||
if (traderOffer is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"customisation-unable_to_find_suit_by_id",
|
||||
buyClothingRequest.Offer
|
||||
)
|
||||
@@ -94,7 +94,7 @@ public class CustomizationController(
|
||||
{
|
||||
var suitDetails = _databaseService.GetCustomization()!.GetValueOrDefault(suitId);
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"customisation-item_already_purchased",
|
||||
new { itemId = suitDetails?.Id, itemName = suitDetails?.Name }
|
||||
)
|
||||
@@ -149,7 +149,7 @@ public class CustomizationController(
|
||||
if (foundSuit is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("customisation-unable_to_find_suit_with_id", offerId)
|
||||
_serverLocalisationService.GetText("customisation-unable_to_find_suit_with_id", offerId)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public class DialogueController(
|
||||
ProfileHelper _profileHelper,
|
||||
ConfigServer _configServer,
|
||||
SaveServer _saveServer,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
MailSendService _mailSendService,
|
||||
IEnumerable<IDialogueChatBot> dialogueChatBots
|
||||
)
|
||||
@@ -38,7 +38,7 @@ public class DialogueController(
|
||||
if (_dialogueChatBots.Any(cb => cb.GetChatBot().Id == chatBot.GetChatBot().Id))
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"dialog-chatbot_id_already_exists",
|
||||
chatBot.GetChatBot().Id
|
||||
)
|
||||
@@ -436,7 +436,7 @@ public class DialogueController(
|
||||
if (!profile.DialogueRecords.ContainsKey(dialogueId))
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"dialogue-unable_to_find_in_profile",
|
||||
new { sessionId, dialogueId }
|
||||
)
|
||||
@@ -460,7 +460,7 @@ public class DialogueController(
|
||||
if (dialog is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"dialogue-unable_to_find_in_profile",
|
||||
new { sessionId, dialogueId }
|
||||
)
|
||||
@@ -484,7 +484,7 @@ public class DialogueController(
|
||||
if (dialogs is null || !dialogs.Any())
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"dialogue-unable_to_find_dialogs_in_profile",
|
||||
new { sessionId }
|
||||
)
|
||||
@@ -513,7 +513,7 @@ public class DialogueController(
|
||||
var dialog = dialogs.TryGetValue(dialogueId, out var dialogInfo);
|
||||
if (!dialog)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("dialogue-unable_to_find_in_profile"));
|
||||
_logger.Error(_serverLocalisationService.GetText("dialogue-unable_to_find_in_profile"));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class GameController(
|
||||
HideoutHelper _hideoutHelper,
|
||||
ProfileHelper _profileHelper,
|
||||
ProfileFixerService _profileFixerService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
PostDbLoadService _postDbLoadService,
|
||||
SeasonalEventService _seasonalEventService,
|
||||
GiftService _giftService,
|
||||
@@ -300,7 +300,7 @@ public class GameController(
|
||||
if (botReloadSkill?.Progress > 0)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("server_start_player_active_botreload_skill")
|
||||
_serverLocalisationService.GetText("server_start_player_active_botreload_skill")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class HealthController(
|
||||
ItemHelper _itemHelper,
|
||||
PaymentService _paymentService,
|
||||
InventoryHelper _inventoryHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
HttpResponseUtil _httpResponseUtil,
|
||||
HealthHelper _healthHelper,
|
||||
ICloner _cloner
|
||||
@@ -49,7 +49,7 @@ public class HealthController(
|
||||
);
|
||||
if (healingItemToUse is null)
|
||||
{
|
||||
var errorMessage = _localisationService.GetText(
|
||||
var errorMessage = _serverLocalisationService.GetText(
|
||||
"health-healing_item_not_found",
|
||||
request.Item
|
||||
);
|
||||
@@ -165,7 +165,10 @@ public class HealthController(
|
||||
{
|
||||
return _httpResponseUtil.AppendErrorToOutput(
|
||||
output,
|
||||
_localisationService.GetText("health-unable_to_find_item_to_consume", request.Item)
|
||||
_serverLocalisationService.GetText(
|
||||
"health-unable_to_find_item_to_consume",
|
||||
request.Item
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class HideoutController(
|
||||
ProfileHelper _profileHelper,
|
||||
HideoutHelper _hideoutHelper,
|
||||
ScavCaseRewardGenerator _scavCaseRewardGenerator,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ProfileActivityService _profileActivityService,
|
||||
FenceService _fenceService,
|
||||
CircleOfCultistService _circleOfCultistService,
|
||||
@@ -86,7 +86,7 @@ public class HideoutController(
|
||||
if (item.inventoryItem is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_item_in_inventory",
|
||||
item.requestedItem.Id
|
||||
)
|
||||
@@ -118,7 +118,7 @@ public class HideoutController(
|
||||
if (profileHideoutArea is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("hideout-unable_to_find_area", request.AreaType)
|
||||
_serverLocalisationService.GetText("hideout-unable_to_find_area", request.AreaType)
|
||||
);
|
||||
_httpResponseUtil.AppendErrorToOutput(output);
|
||||
|
||||
@@ -131,7 +131,7 @@ public class HideoutController(
|
||||
if (hideoutDataDb is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_area_in_database",
|
||||
request.AreaType
|
||||
)
|
||||
@@ -182,7 +182,7 @@ public class HideoutController(
|
||||
if (profileHideoutArea is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("hideout-unable_to_find_area", request.AreaType)
|
||||
_serverLocalisationService.GetText("hideout-unable_to_find_area", request.AreaType)
|
||||
);
|
||||
_httpResponseUtil.AppendErrorToOutput(output);
|
||||
|
||||
@@ -200,7 +200,7 @@ public class HideoutController(
|
||||
if (hideoutData is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_area_in_database",
|
||||
request.AreaType
|
||||
)
|
||||
@@ -484,7 +484,7 @@ public class HideoutController(
|
||||
if (hideoutArea is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_area_in_database",
|
||||
addItemToHideoutRequest.AreaType
|
||||
)
|
||||
@@ -497,7 +497,7 @@ public class HideoutController(
|
||||
if (item.inventoryItem is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_item_in_inventory",
|
||||
new { itemId = item.requestedItem.Id, area = hideoutArea.Type }
|
||||
)
|
||||
@@ -559,7 +559,7 @@ public class HideoutController(
|
||||
if (hideoutArea is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("hideout-unable_to_find_area", request.AreaType)
|
||||
_serverLocalisationService.GetText("hideout-unable_to_find_area", request.AreaType)
|
||||
);
|
||||
return _httpResponseUtil.AppendErrorToOutput(output);
|
||||
}
|
||||
@@ -567,7 +567,7 @@ public class HideoutController(
|
||||
if (hideoutArea.Slots is null || hideoutArea.Slots.Count == 0)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_item_to_remove_from_area",
|
||||
hideoutArea.Type
|
||||
)
|
||||
@@ -586,7 +586,7 @@ public class HideoutController(
|
||||
}
|
||||
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unhandled_remove_item_from_area_request",
|
||||
hideoutArea.Type
|
||||
)
|
||||
@@ -683,7 +683,7 @@ public class HideoutController(
|
||||
if (hideoutArea is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("hideout-unable_to_find_area", request.AreaType)
|
||||
_serverLocalisationService.GetText("hideout-unable_to_find_area", request.AreaType)
|
||||
);
|
||||
return _httpResponseUtil.AppendErrorToOutput(output);
|
||||
}
|
||||
@@ -780,7 +780,7 @@ public class HideoutController(
|
||||
if (inventoryItem is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_scavcase_requested_item_in_profile_inventory",
|
||||
requestedItem.Id
|
||||
)
|
||||
@@ -807,7 +807,7 @@ public class HideoutController(
|
||||
if (recipe is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_scav_case_recipie_in_database",
|
||||
request.RecipeId
|
||||
)
|
||||
@@ -937,7 +937,7 @@ public class HideoutController(
|
||||
}
|
||||
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_production_in_profile_by_recipie_id",
|
||||
request.RecipeId
|
||||
)
|
||||
@@ -987,7 +987,7 @@ public class HideoutController(
|
||||
if (prodId is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_production_in_profile_by_recipie_id",
|
||||
request.RecipeId
|
||||
)
|
||||
@@ -995,7 +995,7 @@ public class HideoutController(
|
||||
|
||||
_httpResponseUtil.AppendErrorToOutput(
|
||||
output,
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_production_in_profile_by_recipie_id",
|
||||
request.RecipeId
|
||||
)
|
||||
@@ -1077,7 +1077,7 @@ public class HideoutController(
|
||||
{
|
||||
_httpResponseUtil.AppendErrorToOutput(
|
||||
output,
|
||||
_localisationService.GetText("inventory-no_stash_space"),
|
||||
_serverLocalisationService.GetText("inventory-no_stash_space"),
|
||||
BackendErrorCodes.NotEnoughSpace
|
||||
);
|
||||
return;
|
||||
@@ -1296,7 +1296,7 @@ public class HideoutController(
|
||||
if (prodId == null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_production_in_profile_by_recipie_id",
|
||||
request.RecipeId
|
||||
)
|
||||
@@ -1497,7 +1497,7 @@ public class HideoutController(
|
||||
if (item.inventoryItem is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_item_in_inventory",
|
||||
item.requestedItem.Id
|
||||
)
|
||||
@@ -1526,7 +1526,7 @@ public class HideoutController(
|
||||
if (profileHideoutArea is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("hideout-unable_to_find_area", request.AreaType)
|
||||
_serverLocalisationService.GetText("hideout-unable_to_find_area", request.AreaType)
|
||||
);
|
||||
return _httpResponseUtil.AppendErrorToOutput(output);
|
||||
}
|
||||
@@ -1537,7 +1537,7 @@ public class HideoutController(
|
||||
if (hideoutDbData is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_find_area_in_database",
|
||||
request.AreaType
|
||||
)
|
||||
|
||||
@@ -37,7 +37,7 @@ public class InsuranceController(
|
||||
DatabaseService _databaseService,
|
||||
MailSendService _mailSendService,
|
||||
RagfairPriceService _ragfairPriceService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
SaveServer _saveServer,
|
||||
TraderStore _traderStore,
|
||||
ConfigServer _configServer,
|
||||
@@ -257,7 +257,7 @@ public class InsuranceController(
|
||||
if (parentItem is null && insuredItem.ParentId != rootItemParentID)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"insurance-unable_to_find_parent_of_item",
|
||||
new
|
||||
{
|
||||
@@ -281,7 +281,7 @@ public class InsuranceController(
|
||||
if (!_itemHelper.GetItem(insuredItem.Template).Key)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"insurance-unable_to_find_attachment_in_db",
|
||||
new
|
||||
{
|
||||
@@ -300,7 +300,7 @@ public class InsuranceController(
|
||||
{
|
||||
// Odd. The parent couldn't be found. Skip this attachment and warn.
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"insurance-unable_to_find_main_parent_for_attachment",
|
||||
new
|
||||
{
|
||||
|
||||
@@ -33,8 +33,7 @@ public class InventoryController(
|
||||
FenceService _fenceService,
|
||||
RagfairOfferService _ragfairOfferService,
|
||||
MapMarkerService _mapMarkerService,
|
||||
LocalisationService _localisationService,
|
||||
PlayerService _playerService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
LootGenerator _lootGenerator,
|
||||
EventOutputHolder _eventOutputHolder,
|
||||
ICloner _cloner
|
||||
@@ -139,7 +138,7 @@ public class InventoryController(
|
||||
{
|
||||
_httpResponseUtil.AppendErrorToOutput(
|
||||
output,
|
||||
_localisationService.GetText("inventory-edit_trader_item"),
|
||||
_serverLocalisationService.GetText("inventory-edit_trader_item"),
|
||||
(BackendErrorCodes)228
|
||||
);
|
||||
}
|
||||
@@ -311,7 +310,7 @@ public class InventoryController(
|
||||
if (!item.Key)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-unable_to_inspect_item_not_in_db",
|
||||
itemTpl
|
||||
)
|
||||
@@ -496,7 +495,7 @@ public class InventoryController(
|
||||
if (inventoryItem is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-unable_to_sort_inventory_restart_game",
|
||||
change.Id
|
||||
)
|
||||
@@ -563,7 +562,7 @@ public class InventoryController(
|
||||
catch
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-examine_item_does_not_exist",
|
||||
request.Item
|
||||
)
|
||||
@@ -654,7 +653,7 @@ public class InventoryController(
|
||||
|
||||
// Unable to find item in database or ragfair
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("inventory-unable_to_find_item", request.Item)
|
||||
_serverLocalisationService.GetText("inventory-unable_to_find_item", request.Item)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -793,7 +792,7 @@ public class InventoryController(
|
||||
{
|
||||
_itemHelper.AddUpdObjectToItem(
|
||||
itemToToggle,
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-item_to_toggle_missing_upd",
|
||||
itemToToggle.Id
|
||||
)
|
||||
@@ -805,7 +804,10 @@ public class InventoryController(
|
||||
}
|
||||
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("inventory-unable_to_toggle_item_not_found", request.Item)
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-unable_to_toggle_item_not_found",
|
||||
request.Item
|
||||
)
|
||||
);
|
||||
|
||||
return new ItemEventRouterResponse { Warnings = [] };
|
||||
@@ -840,7 +842,7 @@ public class InventoryController(
|
||||
{
|
||||
// Item not found
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-unable_to_fold_item_not_found_in_inventory",
|
||||
request.Item
|
||||
)
|
||||
@@ -883,7 +885,7 @@ public class InventoryController(
|
||||
if (itemOne is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-unable_to_find_item_to_swap",
|
||||
new { item1Id = request.Item, item2Id = request.Item2 }
|
||||
)
|
||||
@@ -894,7 +896,7 @@ public class InventoryController(
|
||||
if (itemTwo is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-unable_to_find_item_to_swap",
|
||||
new { item1Id = request.Item2, item2Id = request.Item }
|
||||
)
|
||||
|
||||
@@ -24,7 +24,7 @@ public class LauncherController(
|
||||
HttpServerHelper _httpServerHelper,
|
||||
ProfileHelper _profileHelper,
|
||||
DatabaseService _databaseService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ConfigServer _configServer
|
||||
)
|
||||
{
|
||||
@@ -65,7 +65,10 @@ public class LauncherController(
|
||||
var result = new Dictionary<string, string>();
|
||||
foreach (var (profileKey, profile) in profileTemplates)
|
||||
{
|
||||
result.TryAdd(profileKey, _localisationService.GetText(profile.DescriptionLocaleKey));
|
||||
result.TryAdd(
|
||||
profileKey,
|
||||
_serverLocalisationService.GetText(profile.DescriptionLocaleKey)
|
||||
);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -20,7 +20,7 @@ public class LauncherV2Controller(
|
||||
RandomUtil _randomUtil,
|
||||
SaveServer _saveServer,
|
||||
DatabaseService _databaseService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ConfigServer _configServer,
|
||||
Watermark _watermark
|
||||
)
|
||||
@@ -50,7 +50,7 @@ public class LauncherV2Controller(
|
||||
{
|
||||
result.TryAdd(
|
||||
profileKvP.Key,
|
||||
_localisationService.GetText(profileKvP.Value.DescriptionLocaleKey)
|
||||
_serverLocalisationService.GetText(profileKvP.Value.DescriptionLocaleKey)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ProfileController(
|
||||
DatabaseService _databaseService,
|
||||
ItemHelper _itemHelper,
|
||||
ProfileFixerService _profileFixerService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
CreateProfileService _createProfileService,
|
||||
SeasonalEventService _seasonalEventService,
|
||||
PlayerScavGenerator _playerScavGenerator,
|
||||
|
||||
@@ -24,7 +24,7 @@ public class QuestController(
|
||||
MailSendService _mailSendService,
|
||||
QuestHelper _questHelper,
|
||||
QuestRewardHelper _questRewardHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ICloner _cloner
|
||||
)
|
||||
{
|
||||
@@ -236,7 +236,7 @@ public class QuestController(
|
||||
if (handedInCount <= 0)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"repeatable-quest_handover_failed_condition_already_satisfied",
|
||||
new
|
||||
{
|
||||
@@ -376,7 +376,7 @@ public class QuestController(
|
||||
ItemEventRouterResponse output
|
||||
)
|
||||
{
|
||||
var errorMessage = _localisationService.GetText(
|
||||
var errorMessage = _serverLocalisationService.GetText(
|
||||
"repeatable-quest_handover_failed_condition_invalid",
|
||||
new { questId, conditionId }
|
||||
);
|
||||
@@ -400,7 +400,7 @@ public class QuestController(
|
||||
ItemEventRouterResponse output
|
||||
)
|
||||
{
|
||||
var errorMessage = _localisationService.GetText(
|
||||
var errorMessage = _serverLocalisationService.GetText(
|
||||
"quest-handover_wrong_item",
|
||||
new
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ public class RagfairController
|
||||
protected InventoryHelper _inventoryHelper;
|
||||
protected ItemHelper _itemHelper;
|
||||
protected JsonUtil _jsonUtil;
|
||||
protected LocalisationService _localisationService;
|
||||
protected ServerLocalisationService _serverLocalisationService;
|
||||
protected ISptLogger<RagfairController> _logger;
|
||||
protected PaymentHelper _paymentHelper;
|
||||
protected PaymentService _paymentService;
|
||||
@@ -68,7 +68,7 @@ public class RagfairController
|
||||
RagfairOfferHelper ragfairOfferHelper,
|
||||
TraderHelper traderHelper,
|
||||
DatabaseService databaseService,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
RagfairTaxService ragfairTaxService,
|
||||
RagfairOfferService ragfairOfferService,
|
||||
PaymentService paymentService,
|
||||
@@ -94,7 +94,7 @@ public class RagfairController
|
||||
_ragfairOfferHelper = ragfairOfferHelper;
|
||||
_traderHelper = traderHelper;
|
||||
_databaseService = databaseService;
|
||||
_localisationService = localisationService;
|
||||
_serverLocalisationService = localisationService;
|
||||
_ragfairTaxService = ragfairTaxService;
|
||||
_ragfairOfferService = ragfairOfferService;
|
||||
_paymentService = paymentService;
|
||||
@@ -231,7 +231,7 @@ public class RagfairController
|
||||
{
|
||||
// Occurs when player edits "item count shown per page" value when on page near end of offer list
|
||||
// The page no longer exists due to the larger number of items on each page, show them the very end of the offer list instead
|
||||
_logger.Warning(_localisationService.GetText("ragfair-offer_page_doesnt_exist"));
|
||||
_logger.Warning(_serverLocalisationService.GetText("ragfair-offer_page_doesnt_exist"));
|
||||
startIndex = result.Offers.Count - perPageLimit;
|
||||
endIndex = result.Offers.Count;
|
||||
}
|
||||
@@ -252,7 +252,7 @@ public class RagfairController
|
||||
if (assortPurchased is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"ragfair-unable_to_adjust_stack_count_assort_not_found",
|
||||
new { offerId = offer.Items.First().Id, traderId = offer.User.Id }
|
||||
)
|
||||
@@ -346,7 +346,7 @@ public class RagfairController
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("ragfair-unable_to_get_categories"));
|
||||
_logger.Error(_serverLocalisationService.GetText("ragfair-unable_to_get_categories"));
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug(_jsonUtil.Serialize(searchRequest));
|
||||
@@ -578,7 +578,9 @@ public class RagfairController
|
||||
{
|
||||
if (offerRequest?.Items is null || offerRequest.Items.Count == 0)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("ragfair-invalid_player_offer_request"));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("ragfair-invalid_player_offer_request")
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -586,7 +588,9 @@ public class RagfairController
|
||||
if (offerRequest.Requirements is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("ragfair-unable_to_place_offer_with_no_requirements")
|
||||
_serverLocalisationService.GetText(
|
||||
"ragfair-unable_to_place_offer_with_no_requirements"
|
||||
)
|
||||
);
|
||||
|
||||
return false;
|
||||
@@ -1029,7 +1033,7 @@ public class RagfairController
|
||||
{
|
||||
_httpResponseUtil.AppendErrorToOutput(
|
||||
output,
|
||||
_localisationService.GetText("ragfair-unable_to_pay_commission_fee", tax)
|
||||
_serverLocalisationService.GetText("ragfair-unable_to_pay_commission_fee", tax)
|
||||
);
|
||||
return true;
|
||||
}
|
||||
@@ -1130,7 +1134,7 @@ public class RagfairController
|
||||
var rootItem = pmcData.Inventory?.Items?.FirstOrDefault(i => i.Id == itemId);
|
||||
if (rootItem is null)
|
||||
{
|
||||
errorMessage = _localisationService.GetText(
|
||||
errorMessage = _serverLocalisationService.GetText(
|
||||
"ragfair-unable_to_find_item_in_inventory",
|
||||
new { id = itemId }
|
||||
);
|
||||
@@ -1150,7 +1154,7 @@ public class RagfairController
|
||||
|
||||
if (itemsToReturn?.Count == 0)
|
||||
{
|
||||
errorMessage = _localisationService.GetText(
|
||||
errorMessage = _serverLocalisationService.GetText(
|
||||
"ragfair-unable_to_find_requested_items_in_inventory"
|
||||
);
|
||||
_logger.Error(errorMessage);
|
||||
@@ -1181,7 +1185,7 @@ public class RagfairController
|
||||
if (playerProfileOffers is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"ragfair-unable_to_remove_offer_not_found_in_profile",
|
||||
new { profileId = sessionId, offerId }
|
||||
)
|
||||
@@ -1194,12 +1198,15 @@ public class RagfairController
|
||||
if (playerOffer is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("ragfair-offer_not_found_in_profile", new { offerId })
|
||||
_serverLocalisationService.GetText(
|
||||
"ragfair-offer_not_found_in_profile",
|
||||
new { offerId }
|
||||
)
|
||||
);
|
||||
|
||||
return _httpResponseUtil.AppendErrorToOutput(
|
||||
output,
|
||||
_localisationService.GetText("ragfair-offer_not_found_in_profile_short")
|
||||
_serverLocalisationService.GetText("ragfair-offer_not_found_in_profile_short")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1240,14 +1247,14 @@ public class RagfairController
|
||||
if (playerOfferIndex == -1)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"ragfair-offer_not_found_in_profile",
|
||||
new { offerId = extendRequest.OfferId }
|
||||
)
|
||||
);
|
||||
return _httpResponseUtil.AppendErrorToOutput(
|
||||
output,
|
||||
_localisationService.GetText("ragfair-offer_not_found_in_profile_short")
|
||||
_serverLocalisationService.GetText("ragfair-offer_not_found_in_profile_short")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1278,7 +1285,7 @@ public class RagfairController
|
||||
{
|
||||
return _httpResponseUtil.AppendErrorToOutput(
|
||||
output,
|
||||
_localisationService.GetText("ragfair-unable_to_pay_commission_fee")
|
||||
_serverLocalisationService.GetText("ragfair-unable_to_pay_commission_fee")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class RepeatableQuestController(
|
||||
HttpResponseUtil _httpResponseUtil,
|
||||
ProfileHelper _profileHelper,
|
||||
ProfileFixerService _profileFixerService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
EventOutputHolder _eventOutputHolder,
|
||||
PaymentService _paymentService,
|
||||
RepeatableQuestHelper _repeatableQuestHelper,
|
||||
@@ -76,14 +76,14 @@ public class RepeatableQuestController(
|
||||
if (repeatableQuestProfile is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"repeatable-accepted_repeatable_quest_not_found_in_active_quests",
|
||||
acceptedQuest.QuestId
|
||||
)
|
||||
);
|
||||
|
||||
throw new Exception(
|
||||
_localisationService.GetText("repeatable-unable_to_accept_quest_see_log")
|
||||
_serverLocalisationService.GetText("repeatable-unable_to_accept_quest_see_log")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class RepeatableQuestController(
|
||||
if (repeatables.RepeatableType is null || repeatables.Quest is null)
|
||||
{
|
||||
// Unable to find quest being replaced
|
||||
var message = _localisationService.GetText(
|
||||
var message = _serverLocalisationService.GetText(
|
||||
"quest-unable_to_find_repeatable_to_replace"
|
||||
);
|
||||
_logger.Error(message);
|
||||
@@ -397,7 +397,7 @@ public class RepeatableQuestController(
|
||||
if (attempts > maxAttempts)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"quest-repeatable_generation_failed_please_report",
|
||||
attempts
|
||||
)
|
||||
@@ -440,7 +440,9 @@ public class RepeatableQuestController(
|
||||
var traderId = _randomUtil.DrawRandomFromList(traders).FirstOrDefault();
|
||||
if (traderId is null)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("repeatable-unable_to_find_trader_in_pool"));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("repeatable-unable_to_find_trader_in_pool")
|
||||
);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TradeController(
|
||||
TraderHelper _traderHelper,
|
||||
RagfairServer _ragfairServer,
|
||||
HttpResponseUtil _httpResponseUtil,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
RagfairPriceService _ragfairPriceService,
|
||||
MailSendService _mailSendService,
|
||||
ConfigServer _configServer
|
||||
@@ -114,7 +114,7 @@ public class TradeController(
|
||||
|
||||
if (offer.Count == 0)
|
||||
{
|
||||
var errorMessage = _localisationService.GetText(
|
||||
var errorMessage = _serverLocalisationService.GetText(
|
||||
"ragfair-unable_to_purchase_0_count_item",
|
||||
_itemHelper.GetItem(fleaOffer.Items[0].Template).Value.Name
|
||||
);
|
||||
|
||||
@@ -34,7 +34,7 @@ public class BotEquipmentModGenerator(
|
||||
BotWeaponGeneratorHelper _botWeaponGeneratorHelper,
|
||||
WeightedRandomHelper _weightedRandomHelper,
|
||||
PresetHelper _presetHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
BotEquipmentModPoolService _botEquipmentModPoolService,
|
||||
ConfigServer _configServer,
|
||||
ICloner _cloner
|
||||
@@ -124,7 +124,7 @@ public class BotEquipmentModGenerator(
|
||||
if (itemSlotTemplate is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-mod_slot_missing_from_item",
|
||||
new
|
||||
{
|
||||
@@ -518,7 +518,7 @@ public class BotEquipmentModGenerator(
|
||||
if (ItemLacksSlotsCartridgesAndChambers(request.ParentTemplate))
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-unable_to_add_mods_to_weapon_missing_ammo_slot",
|
||||
new
|
||||
{
|
||||
@@ -562,7 +562,7 @@ public class BotEquipmentModGenerator(
|
||||
if (modsParentSlot is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-weapon_missing_mod_slot",
|
||||
new
|
||||
{
|
||||
@@ -1772,7 +1772,7 @@ public class BotEquipmentModGenerator(
|
||||
if (modBeingAddedDbTemplate.Value is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-no_item_template_found_when_adding_mod",
|
||||
new { modId = modBeingAddedDbTemplate.Value?.Id ?? "UNKNOWN", modSlot }
|
||||
)
|
||||
@@ -1792,7 +1792,7 @@ public class BotEquipmentModGenerator(
|
||||
if (slotAddedToTemplate.Required ?? false)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-unable_to_add_mod_item_invalid",
|
||||
new
|
||||
{
|
||||
@@ -1847,7 +1847,7 @@ public class BotEquipmentModGenerator(
|
||||
if (!filteredMods.Any())
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-unable_to_filter_mods_all_blacklisted",
|
||||
new { slotName = desiredSlotObject.Name, itemName = modTemplate.Name }
|
||||
)
|
||||
@@ -1890,7 +1890,10 @@ public class BotEquipmentModGenerator(
|
||||
}
|
||||
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("bot-unable_to_filter_mod_slot_all_blacklisted", modSlot)
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-unable_to_filter_mod_slot_all_blacklisted",
|
||||
modSlot
|
||||
)
|
||||
);
|
||||
|
||||
return modsFromDynamicPool;
|
||||
@@ -1953,7 +1956,7 @@ public class BotEquipmentModGenerator(
|
||||
if (!modPool.TryGetValue(cylinderMagTemplate.Id, out var itemModPool))
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-unable_to_fill_camora_slot_mod_pool_empty",
|
||||
new { weaponId = cylinderMagTemplate.Id, weaponName = cylinderMagTemplate.Name }
|
||||
)
|
||||
@@ -1989,7 +1992,10 @@ public class BotEquipmentModGenerator(
|
||||
else
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("bot-missing_cartridge_slot", cylinderMagTemplate.Id)
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-missing_cartridge_slot",
|
||||
cylinderMagTemplate.Id
|
||||
)
|
||||
);
|
||||
|
||||
return;
|
||||
@@ -2014,7 +2020,7 @@ public class BotEquipmentModGenerator(
|
||||
if (!found)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("bot-no_compatible_camora_ammo_found", modSlot)
|
||||
_serverLocalisationService.GetText("bot-no_compatible_camora_ammo_found", modSlot)
|
||||
);
|
||||
|
||||
return;
|
||||
|
||||
@@ -29,7 +29,7 @@ public class BotInventoryGenerator(
|
||||
WeightedRandomHelper _weightedRandomHelper,
|
||||
ItemHelper _itemHelper,
|
||||
WeatherHelper _weatherHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
BotEquipmentFilterService _botEquipmentFilterService,
|
||||
BotEquipmentModPoolService _botEquipmentModPoolService,
|
||||
BotEquipmentModGenerator _botEquipmentModGenerator,
|
||||
@@ -497,7 +497,7 @@ public class BotInventoryGenerator(
|
||||
if (!spawnChance.HasValue)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-no_spawn_chance_defined_for_equipment_slot",
|
||||
settings.RootEquipmentSlot
|
||||
)
|
||||
@@ -531,7 +531,7 @@ public class BotInventoryGenerator(
|
||||
if (!dbResult.Key)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("bot-missing_item_template", chosenItemTpl)
|
||||
_serverLocalisationService.GetText("bot-missing_item_template", chosenItemTpl)
|
||||
);
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ public class BotLootGenerator(
|
||||
WeightedRandomHelper _weightedRandomHelper,
|
||||
BotHelper _botHelper,
|
||||
BotLootCacheService _botLootCacheService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ConfigServer _configServer,
|
||||
ICloner _cloner
|
||||
)
|
||||
@@ -94,7 +94,7 @@ public class BotLootGenerator(
|
||||
)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("bot-unable_to_generate_bot_loot", botRole)
|
||||
_serverLocalisationService.GetText("bot-unable_to_generate_bot_loot", botRole)
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -875,7 +875,7 @@ public class BotLootGenerator(
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-item_spawn_limit_reached_skipping_item",
|
||||
new
|
||||
{
|
||||
@@ -952,7 +952,7 @@ public class BotLootGenerator(
|
||||
}
|
||||
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-unable_to_find_spawn_limits_fallback_to_defaults",
|
||||
botRole
|
||||
)
|
||||
|
||||
@@ -28,7 +28,7 @@ public class BotWeaponGenerator(
|
||||
BotWeaponGeneratorHelper _botWeaponGeneratorHelper,
|
||||
BotWeaponModLimitService _botWeaponModLimitService,
|
||||
BotEquipmentModGenerator _botEquipmentModGenerator,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
RepairService _repairService,
|
||||
ICloner _cloner,
|
||||
ConfigServer _configServer,
|
||||
@@ -137,7 +137,9 @@ public class BotWeaponGenerator(
|
||||
|
||||
if (weaponItemTemplate is null)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("bot-missing_item_template", weaponTpl));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("bot-missing_item_template", weaponTpl)
|
||||
);
|
||||
_logger.Error($"WeaponSlot -> {slotName}");
|
||||
|
||||
return null;
|
||||
@@ -146,8 +148,10 @@ public class BotWeaponGenerator(
|
||||
// Find ammo to use when filling magazines/chamber
|
||||
if (botTemplateInventory.Ammo is null)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("bot-no_ammo_found_in_bot_json", botRole));
|
||||
_logger.Error(_localisationService.GetText("bot-generation_failed"));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("bot-no_ammo_found_in_bot_json", botRole)
|
||||
);
|
||||
_logger.Error(_serverLocalisationService.GetText("bot-generation_failed"));
|
||||
}
|
||||
|
||||
var ammoTpl = GetWeightedCompatibleAmmo(botTemplateInventory.Ammo, weaponItemTemplate);
|
||||
@@ -356,7 +360,7 @@ public class BotWeaponGenerator(
|
||||
{
|
||||
// Invalid weapon generated, fallback to preset
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-weapon_generated_incorrect_using_default",
|
||||
$"{weaponTemplate} - {itemTemplate.Name}"
|
||||
)
|
||||
@@ -390,7 +394,7 @@ public class BotWeaponGenerator(
|
||||
else
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("bot-missing_weapon_preset", weaponTemplate)
|
||||
_serverLocalisationService.GetText("bot-missing_weapon_preset", weaponTemplate)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -427,7 +431,7 @@ public class BotWeaponGenerator(
|
||||
if (!hasWeaponSlotItem)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-weapons_required_slot_missing_item",
|
||||
new
|
||||
{
|
||||
@@ -474,7 +478,7 @@ public class BotWeaponGenerator(
|
||||
if (magTemplate is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("bot-unable_to_find_magazine_item", magazineTpl)
|
||||
_serverLocalisationService.GetText("bot-unable_to_find_magazine_item", magazineTpl)
|
||||
);
|
||||
|
||||
return;
|
||||
@@ -485,7 +489,7 @@ public class BotWeaponGenerator(
|
||||
if (!ammoTemplate.Key)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-unable_to_find_ammo_item",
|
||||
generatedWeaponResult.ChosenAmmoTemplate
|
||||
)
|
||||
@@ -628,7 +632,7 @@ public class BotWeaponGenerator(
|
||||
// Shouldn't happen
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-weapon_missing_magazine_or_chamber",
|
||||
new { weaponId = weaponTemplate.Id, botRole }
|
||||
)
|
||||
@@ -636,6 +640,7 @@ public class BotWeaponGenerator(
|
||||
}
|
||||
|
||||
var defaultMagTplId = weaponTemplate.GetWeaponsDefaultMagazineTpl();
|
||||
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug(
|
||||
@@ -669,7 +674,7 @@ public class BotWeaponGenerator(
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-no_caliber_data_for_weapon_falling_back_to_default",
|
||||
new
|
||||
{
|
||||
@@ -854,7 +859,10 @@ public class BotWeaponGenerator(
|
||||
if (magazineTemplate is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("bot-unable_to_find_magazine_item", magazine.Template)
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-unable_to_find_magazine_item",
|
||||
magazine.Template
|
||||
)
|
||||
);
|
||||
|
||||
return;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class FenceBaseAssortGenerator(
|
||||
PresetHelper presetHelper,
|
||||
ItemFilterService itemFilterService,
|
||||
SeasonalEventService seasonalEventService,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
ConfigServer configServer,
|
||||
FenceService fenceService,
|
||||
ICloner _cloner
|
||||
|
||||
@@ -26,7 +26,7 @@ public class LocationLootGenerator(
|
||||
DatabaseService _databaseService,
|
||||
ContainerHelper _containerHelper,
|
||||
PresetHelper _presetHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
SeasonalEventService _seasonalEventService,
|
||||
ItemFilterService _itemFilterService,
|
||||
ConfigServer _configServer,
|
||||
@@ -83,12 +83,14 @@ public class LocationLootGenerator(
|
||||
result.AddRange(dynamicSpawnPoints);
|
||||
|
||||
_logger.Success(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-dynamic_items_spawned_success",
|
||||
dynamicSpawnPoints.Count
|
||||
)
|
||||
);
|
||||
_logger.Success(_localisationService.GetText("location-generated_success", locationId));
|
||||
_logger.Success(
|
||||
_serverLocalisationService.GetText("location-generated_success", locationId)
|
||||
);
|
||||
|
||||
// Clean up tracker
|
||||
counterTrackerHelper.Clear();
|
||||
@@ -114,7 +116,7 @@ public class LocationLootGenerator(
|
||||
if (staticWeaponsOnMapClone is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-unable_to_find_static_weapon_for_map",
|
||||
locationId
|
||||
)
|
||||
@@ -130,7 +132,7 @@ public class LocationLootGenerator(
|
||||
if (allStaticContainersOnMapClone is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-unable_to_find_static_container_for_map",
|
||||
locationId
|
||||
)
|
||||
@@ -142,7 +144,7 @@ public class LocationLootGenerator(
|
||||
if (staticForcedOnMapClone is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-unable_to_find_forced_static_data_for_map",
|
||||
locationId
|
||||
)
|
||||
@@ -230,7 +232,10 @@ public class LocationLootGenerator(
|
||||
if (mapData.Statics is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("location-unable_to_generate_static_loot", locationId)
|
||||
_serverLocalisationService.GetText(
|
||||
"location-unable_to_generate_static_loot",
|
||||
locationId
|
||||
)
|
||||
);
|
||||
|
||||
return result;
|
||||
@@ -324,7 +329,7 @@ public class LocationLootGenerator(
|
||||
|
||||
_logger.Success($"A total of: {staticLootItemCount} static items spawned");
|
||||
_logger.Success(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-containers_generated_success",
|
||||
staticContainerCount
|
||||
)
|
||||
@@ -473,7 +478,7 @@ public class LocationLootGenerator(
|
||||
)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-unable_to_find_container_in_statics_json",
|
||||
container.Template.Id
|
||||
)
|
||||
@@ -658,7 +663,7 @@ public class LocationLootGenerator(
|
||||
if (countDistribution is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-unable_to_find_count_distribution_for_container",
|
||||
new { containerId = containerTypeId, locationName }
|
||||
)
|
||||
@@ -704,7 +709,7 @@ public class LocationLootGenerator(
|
||||
if (itemContainerDistribution is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-missing_item_distribution_data",
|
||||
containerTypeId
|
||||
)
|
||||
@@ -874,7 +879,7 @@ public class LocationLootGenerator(
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-spawn_point_count_requested_vs_found",
|
||||
new
|
||||
{
|
||||
@@ -896,7 +901,7 @@ public class LocationLootGenerator(
|
||||
if (spawnPoint.Template is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-missing_dynamic_template",
|
||||
spawnPoint.LocationId
|
||||
)
|
||||
@@ -926,7 +931,7 @@ public class LocationLootGenerator(
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-spawnpoint_missing_items",
|
||||
spawnPoint.Template.Id
|
||||
)
|
||||
@@ -960,7 +965,7 @@ public class LocationLootGenerator(
|
||||
if (itemArray.Count == 0)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-loot_pool_is_empty_skipping",
|
||||
spawnPoint.Template.Id
|
||||
)
|
||||
@@ -1316,7 +1321,7 @@ public class LocationLootGenerator(
|
||||
// 5ea03f7400685063ec28bfa8 // ppsh default
|
||||
// 5ba26383d4351e00334c93d9 //mp7_devgru
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-preset_not_found",
|
||||
new
|
||||
{
|
||||
@@ -1345,13 +1350,15 @@ public class LocationLootGenerator(
|
||||
if (rootItem is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-missing_root_item",
|
||||
new { tpl = chosenTpl, parentId }
|
||||
)
|
||||
);
|
||||
|
||||
throw new Exception(_localisationService.GetText("location-critical_error_see_log"));
|
||||
throw new Exception(
|
||||
_serverLocalisationService.GetText("location-critical_error_see_log")
|
||||
);
|
||||
}
|
||||
|
||||
try
|
||||
@@ -1364,7 +1371,7 @@ public class LocationLootGenerator(
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-unable_to_reparent_item",
|
||||
new { tpl = chosenTpl, parentId }
|
||||
)
|
||||
|
||||
@@ -24,7 +24,7 @@ public class LootGenerator(
|
||||
PresetHelper _presetHelper,
|
||||
DatabaseService _databaseService,
|
||||
ItemFilterService _itemFilterService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
WeightedRandomHelper _weightedRandomHelper,
|
||||
RagfairLinkedItemService _ragfairLinkedItemService,
|
||||
SeasonalEventService _seasonalEventService,
|
||||
@@ -431,7 +431,7 @@ public class LootGenerator(
|
||||
{
|
||||
if (presetPool.Count == 0)
|
||||
{
|
||||
_logger.Warning(_localisationService.GetText("loot-preset_pool_is_empty"));
|
||||
_logger.Warning(_serverLocalisationService.GetText("loot-preset_pool_is_empty"));
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -445,7 +445,7 @@ public class LootGenerator(
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"loot-chosen_preset_missing_encyclopedia_value",
|
||||
chosenPreset?.Id
|
||||
)
|
||||
@@ -479,7 +479,7 @@ public class LootGenerator(
|
||||
if (itemDbDetails.Value?.Parent is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"loot-item_missing_parentid",
|
||||
itemDbDetails.Value?.Name
|
||||
)
|
||||
@@ -537,7 +537,7 @@ public class LootGenerator(
|
||||
if (!weaponDetailsDb.Key)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"loot-non_item_picked_as_sealed_weapon_crate_reward",
|
||||
chosenWeaponTpl
|
||||
)
|
||||
@@ -555,7 +555,7 @@ public class LootGenerator(
|
||||
if (chosenWeaponPreset is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"loot-default_preset_not_found_using_random",
|
||||
chosenWeaponTpl
|
||||
)
|
||||
|
||||
@@ -30,7 +30,7 @@ public class PlayerScavGenerator(
|
||||
BotHelper _botHelper,
|
||||
FenceService _fenceService,
|
||||
BotLootCacheService _botLootCacheService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
BotGenerator _botGenerator,
|
||||
ConfigServer _configServer,
|
||||
ICloner _cloner,
|
||||
@@ -64,7 +64,7 @@ public class PlayerScavGenerator(
|
||||
)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("scav-missing_karma_settings", scavKarmaLevel)
|
||||
_serverLocalisationService.GetText("scav-missing_karma_settings", scavKarmaLevel)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -163,7 +163,10 @@ public class PlayerScavGenerator(
|
||||
if (!itemResult.Key)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("scav-unable_to_add_item_to_player_scav", tpl)
|
||||
_serverLocalisationService.GetText(
|
||||
"scav-unable_to_add_item_to_player_scav",
|
||||
tpl
|
||||
)
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class RagfairOfferGenerator(
|
||||
RagfairAssortGenerator ragfairAssortGenerator,
|
||||
RagfairOfferService ragfairOfferService,
|
||||
RagfairPriceService ragfairPriceService,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
PaymentHelper paymentHelper,
|
||||
ItemHelper itemHelper,
|
||||
ConfigServer configServer,
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ public class CompletionQuestGenerator(
|
||||
RepeatableQuestRewardGenerator repeatableQuestRewardGenerator,
|
||||
DatabaseService databaseService,
|
||||
SeasonalEventService seasonalEventService,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
ConfigServer configServer,
|
||||
RandomUtil randomUtil,
|
||||
MathUtil mathUtil,
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ public class EliminationQuestGenerator(
|
||||
ItemHelper itemHelper,
|
||||
RepeatableQuestRewardGenerator repeatableQuestRewardGenerator,
|
||||
DatabaseService databaseService,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
ConfigServer configServer,
|
||||
ICloner cloner
|
||||
) : IRepeatableQuestGenerator
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ public class ExplorationQuestGenerator(
|
||||
RepeatableQuestHelper repeatableQuestHelper,
|
||||
RepeatableQuestRewardGenerator repeatableQuestRewardGenerator,
|
||||
DatabaseService databaseService,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
ConfigServer configServer,
|
||||
RandomUtil randomUtil,
|
||||
MathUtil mathUtil,
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ public class PickupQuestGenerator(
|
||||
RepeatableQuestHelper repeatableQuestHelper,
|
||||
RepeatableQuestRewardGenerator repeatableQuestRewardGenerator,
|
||||
DatabaseService databaseService,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
RandomUtil randomUtil,
|
||||
MathUtil mathUtil,
|
||||
HashUtil hashUtil
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ public class RepeatableQuestRewardGenerator(
|
||||
ItemHelper itemHelper,
|
||||
PresetHelper presetHelper,
|
||||
HandbookHelper handbookHelper,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
ItemFilterService itemFilterService,
|
||||
SeasonalEventService seasonalEventService,
|
||||
ConfigServer configServer,
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ScavCaseRewardGenerator(
|
||||
RagfairPriceService _ragfairPriceService,
|
||||
SeasonalEventService _seasonalEventService,
|
||||
ItemFilterService _itemFilterService,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
ConfigServer _configServer,
|
||||
ICloner _cloner
|
||||
)
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ namespace SPTarkov.Server.Core.Generators.WeaponGen.Implementations;
|
||||
public class ExternalInventoryMagGen(
|
||||
ISptLogger<ExternalInventoryMagGen> _logger,
|
||||
ItemHelper _itemHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
BotWeaponGeneratorHelper _botWeaponGeneratorHelper,
|
||||
BotGeneratorHelper _botGeneratorHelper,
|
||||
RandomUtil _randomUtil
|
||||
@@ -115,7 +115,7 @@ public class ExternalInventoryMagGen(
|
||||
if (magTemplate is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-unable_to_find_default_magazine_item",
|
||||
magazineTpl
|
||||
)
|
||||
|
||||
@@ -14,7 +14,7 @@ public class AssortHelper(
|
||||
ISptLogger<AssortHelper> _logger,
|
||||
ItemHelper _itemHelper,
|
||||
DatabaseServer _databaseServer,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
QuestHelper _questHelper
|
||||
)
|
||||
{
|
||||
@@ -41,7 +41,7 @@ public class AssortHelper(
|
||||
if (traderAssorts.LoyalLevelItems is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("assort-missing_loyalty_level_object", traderId)
|
||||
_serverLocalisationService.GetText("assort-missing_loyalty_level_object", traderId)
|
||||
);
|
||||
|
||||
return traderAssorts;
|
||||
@@ -133,7 +133,7 @@ public class AssortHelper(
|
||||
if (assort.LoyalLevelItems is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("assort-missing_loyalty_level_object", traderId)
|
||||
_serverLocalisationService.GetText("assort-missing_loyalty_level_object", traderId)
|
||||
);
|
||||
|
||||
return strippedAssort;
|
||||
|
||||
@@ -15,7 +15,7 @@ public class BotDifficultyHelper(
|
||||
ISptLogger<BotDifficultyHelper> _logger,
|
||||
DatabaseService _databaseService,
|
||||
RandomUtil _randomUtil,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
BotHelper _botHelper,
|
||||
ConfigServer _configServer,
|
||||
ICloner _cloner
|
||||
@@ -43,7 +43,10 @@ public class BotDifficultyHelper(
|
||||
{
|
||||
// No bot found, get fallback difficulty values
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("bot-unable_to_get_bot_fallback_to_assault", type)
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-unable_to_get_bot_fallback_to_assault",
|
||||
type
|
||||
)
|
||||
);
|
||||
botDb.Types[desiredType] = _cloner.Clone(botDb.Types["assault"]);
|
||||
}
|
||||
@@ -55,7 +58,7 @@ public class BotDifficultyHelper(
|
||||
{
|
||||
// No bot settings found, use 'assault' bot difficulty instead
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-unable_to_get_bot_difficulty_fallback_to_assault",
|
||||
new { botType = desiredType, difficulty = desiredDifficulty }
|
||||
)
|
||||
|
||||
@@ -23,7 +23,7 @@ public class BotGeneratorHelper(
|
||||
InventoryHelper _inventoryHelper,
|
||||
ContainerHelper _containerHelper,
|
||||
ProfileActivityService _profileActivityService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ConfigServer _configServer
|
||||
)
|
||||
{
|
||||
@@ -265,7 +265,7 @@ public class BotGeneratorHelper(
|
||||
if (botEquipmentSettings is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-missing_equipment_settings",
|
||||
new
|
||||
{
|
||||
@@ -293,7 +293,7 @@ public class BotGeneratorHelper(
|
||||
}
|
||||
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-missing_equipment_settings_property",
|
||||
new
|
||||
{
|
||||
@@ -406,7 +406,7 @@ public class BotGeneratorHelper(
|
||||
if (!itemIsValid)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-invalid_item_compatibility_check",
|
||||
new { itemTpl = tplToCheck, slot = equipmentSlot }
|
||||
)
|
||||
@@ -423,7 +423,7 @@ public class BotGeneratorHelper(
|
||||
if (itemToEquip?.Properties is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-compatibility_check_missing_props",
|
||||
new
|
||||
{
|
||||
@@ -648,7 +648,7 @@ public class BotGeneratorHelper(
|
||||
if (!key)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-missing_container_with_tpl",
|
||||
container.Template
|
||||
)
|
||||
|
||||
@@ -18,7 +18,7 @@ public class BotWeaponGeneratorHelper(
|
||||
HashUtil _hashUtil,
|
||||
WeightedRandomHelper _weightedRandomHelper,
|
||||
BotGeneratorHelper _botGeneratorHelper,
|
||||
LocalisationService _localisationService
|
||||
ServerLocalisationService _serverLocalisationService
|
||||
)
|
||||
{
|
||||
private static readonly FrozenSet<string> _magCheck =
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace SPTarkov.Server.Core.Helpers.Dialogue;
|
||||
public abstract class AbstractDialogChatBot(
|
||||
ISptLogger<AbstractDialogChatBot> _logger,
|
||||
MailSendService _mailSendService,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
IEnumerable<IChatCommand> chatCommands
|
||||
) : IDialogueChatBot
|
||||
{
|
||||
|
||||
@@ -11,17 +11,17 @@ namespace SPTarkov.Server.Core.Helpers.Dialog.Commando;
|
||||
[Injectable]
|
||||
public class SptCommandoCommands : IChatCommand
|
||||
{
|
||||
protected readonly LocalisationService _localisationService;
|
||||
protected readonly ServerLocalisationService _serverLocalisationService;
|
||||
protected readonly IDictionary<string, ISptCommand> _sptCommands;
|
||||
|
||||
public SptCommandoCommands(
|
||||
ConfigServer configServer,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
IEnumerable<ISptCommand> sptCommands
|
||||
)
|
||||
{
|
||||
_sptCommands = sptCommands.ToDictionary(command => command.GetCommand());
|
||||
_localisationService = localisationService;
|
||||
_serverLocalisationService = localisationService;
|
||||
var coreConfigs = configServer.GetConfig<CoreConfig>();
|
||||
var commandoId = coreConfigs.Features?.ChatbotFeatures.Ids.GetValueOrDefault("commando");
|
||||
if (
|
||||
@@ -66,7 +66,7 @@ public class SptCommandoCommands : IChatCommand
|
||||
if (!_sptCommands.TryAdd(key, command))
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"chat-unable_to_register_command_already_registered",
|
||||
key
|
||||
)
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace SPTarkov.Server.Core.Helpers.Dialogue;
|
||||
public class CommandoDialogChatBot(
|
||||
ISptLogger<AbstractDialogChatBot> logger,
|
||||
MailSendService mailSendService,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
ConfigServer _configServer,
|
||||
IEnumerable<IChatCommand> chatCommands
|
||||
) : AbstractDialogChatBot(logger, mailSendService, localisationService, chatCommands)
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ namespace SPTarkov.Server.Core.Helpers.Dialogue.SPTFriend.Commands;
|
||||
|
||||
[Injectable]
|
||||
public class ForceChristmasMessageHandler(
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
MailSendService _mailSendService,
|
||||
RandomUtil _randomUtil,
|
||||
SeasonalEventService _seasonalEventService
|
||||
@@ -42,7 +42,7 @@ public class ForceChristmasMessageHandler(
|
||||
sptFriendUser,
|
||||
_randomUtil.GetArrayValue(
|
||||
[
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"chatbot-forced_event_enabled",
|
||||
SeasonalEventType.Christmas
|
||||
),
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ namespace SPTarkov.Server.Core.Helpers.Dialogue.SPTFriend.Commands;
|
||||
|
||||
[Injectable]
|
||||
public class ForceHalloweenMessageHandler(
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
MailSendService _mailSendService,
|
||||
RandomUtil _randomUtil,
|
||||
SeasonalEventService _seasonalEventService
|
||||
@@ -42,7 +42,7 @@ public class ForceHalloweenMessageHandler(
|
||||
sptFriendUser,
|
||||
_randomUtil.GetArrayValue(
|
||||
[
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"chatbot-forced_event_enabled",
|
||||
SeasonalEventType.Halloween
|
||||
),
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ namespace SPTarkov.Server.Core.Helpers.Dialogue.SPTFriend.Commands;
|
||||
|
||||
[Injectable]
|
||||
public class ForceSnowMessageHandler(
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
MailSendService _mailSendService,
|
||||
RandomUtil _randomUtil,
|
||||
ConfigServer _configServer
|
||||
@@ -41,7 +41,7 @@ public class ForceSnowMessageHandler(
|
||||
_mailSendService.SendUserMessageToPlayer(
|
||||
sessionId,
|
||||
sptFriendUser,
|
||||
_randomUtil.GetArrayValue([_localisationService.GetText("chatbot-snow_enabled")]),
|
||||
_randomUtil.GetArrayValue([_serverLocalisationService.GetText("chatbot-snow_enabled")]),
|
||||
[],
|
||||
null
|
||||
);
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ namespace SPTarkov.Server.Core.Helpers.Dialogue.SPTFriend.Commands;
|
||||
|
||||
[Injectable]
|
||||
public class ForceSummerMessageHandler(
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
MailSendService _mailSendService,
|
||||
RandomUtil _randomUtil,
|
||||
ConfigServer _configServer
|
||||
@@ -41,7 +41,7 @@ public class ForceSummerMessageHandler(
|
||||
_mailSendService.SendUserMessageToPlayer(
|
||||
sessionId,
|
||||
sptFriendUser,
|
||||
_randomUtil.GetArrayValue([_localisationService.GetText("chatbot-summer_enabled")]),
|
||||
_randomUtil.GetArrayValue([_serverLocalisationService.GetText("chatbot-summer_enabled")]),
|
||||
[],
|
||||
null
|
||||
);
|
||||
|
||||
+3
-3
@@ -11,7 +11,7 @@ namespace SPTarkov.Server.Core.Helpers.Dialogue.SPTFriend.Commands;
|
||||
[Injectable]
|
||||
public class GiveMeSpaceMessageHandler(
|
||||
ProfileHelper _profileHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
MailSendService _mailSendService,
|
||||
RandomUtil _randomUtil,
|
||||
ConfigServer _configServer
|
||||
@@ -50,7 +50,7 @@ public class GiveMeSpaceMessageHandler(
|
||||
_mailSendService.SendUserMessageToPlayer(
|
||||
sessionId,
|
||||
sptFriendUser,
|
||||
_localisationService.GetText("chatbot-cannot_accept_any_more_of_gift"),
|
||||
_serverLocalisationService.GetText("chatbot-cannot_accept_any_more_of_gift"),
|
||||
[],
|
||||
null
|
||||
);
|
||||
@@ -63,7 +63,7 @@ public class GiveMeSpaceMessageHandler(
|
||||
sessionId,
|
||||
sptFriendUser,
|
||||
_randomUtil.GetArrayValue(
|
||||
[_localisationService.GetText("chatbot-added_stash_rows_please_restart")]
|
||||
[_serverLocalisationService.GetText("chatbot-added_stash_rows_please_restart")]
|
||||
),
|
||||
[],
|
||||
null
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace SPTarkov.Server.Core.Helpers;
|
||||
public class HideoutHelper(
|
||||
ISptLogger<HideoutHelper> _logger,
|
||||
TimeUtil _timeUtil,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
HashUtil _hashUtil,
|
||||
DatabaseService _databaseService,
|
||||
EventOutputHolder _eventOutputHolder,
|
||||
@@ -57,7 +57,7 @@ public class HideoutHelper(
|
||||
if (recipe is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-missing_recipe_in_db",
|
||||
productionRequest.RecipeId
|
||||
)
|
||||
@@ -136,7 +136,7 @@ public class HideoutHelper(
|
||||
if (recipe is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-missing_recipe_in_db",
|
||||
productionRequest.RecipeId
|
||||
)
|
||||
@@ -212,7 +212,7 @@ public class HideoutHelper(
|
||||
if (stashItem is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-unable_to_apply_stashsize_bonus_no_stash_found",
|
||||
profileData.Inventory.Stash
|
||||
)
|
||||
@@ -331,7 +331,7 @@ public class HideoutHelper(
|
||||
if (craft.Progress == null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"hideout-craft_has_undefined_progress_value_defaulting",
|
||||
prodId
|
||||
)
|
||||
@@ -386,7 +386,7 @@ public class HideoutHelper(
|
||||
if (recipe is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("hideout-missing_recipe_for_area", prodId)
|
||||
_serverLocalisationService.GetText("hideout-missing_recipe_for_area", prodId)
|
||||
);
|
||||
|
||||
continue;
|
||||
@@ -782,7 +782,9 @@ public class HideoutHelper(
|
||||
.Production.Recipes.FirstOrDefault(production => production.Id == recipeId);
|
||||
if (recipe is null)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("hideout-missing_recipe_in_db", recipeId));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("hideout-missing_recipe_in_db", recipeId)
|
||||
);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -1119,7 +1121,7 @@ public class HideoutHelper(
|
||||
{
|
||||
if (btcProduction is null)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("hideout-bitcoin_craft_missing"));
|
||||
_logger.Error(_serverLocalisationService.GetText("hideout-bitcoin_craft_missing"));
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1402,7 +1404,7 @@ public class HideoutHelper(
|
||||
var craftedCoinCount = bitcoinCraft?.Products?.Count;
|
||||
if (bitcoinCraft is null || craftedCoinCount is null)
|
||||
{
|
||||
var errorMsg = _localisationService.GetText("hideout-no_bitcoins_to_collect");
|
||||
var errorMsg = _serverLocalisationService.GetText("hideout-no_bitcoins_to_collect");
|
||||
_logger.Error(errorMsg);
|
||||
|
||||
_httpResponseUtil.AppendErrorToOutput(output, errorMsg);
|
||||
|
||||
@@ -31,7 +31,7 @@ public class InventoryHelper(
|
||||
EventOutputHolder _eventOutputHolder,
|
||||
ProfileHelper _profileHelper,
|
||||
ItemHelper _itemHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ConfigServer _configServer,
|
||||
ICloner _cloner
|
||||
)
|
||||
@@ -65,7 +65,7 @@ public class InventoryHelper(
|
||||
// No space, exit
|
||||
_httpResponseUtil.AppendErrorToOutput(
|
||||
output,
|
||||
_localisationService.GetText("inventory-no_stash_space"),
|
||||
_serverLocalisationService.GetText("inventory-no_stash_space"),
|
||||
BackendErrorCodes.NotEnoughSpace
|
||||
);
|
||||
|
||||
@@ -285,7 +285,7 @@ public class InventoryHelper(
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-unable_to_fit_item_into_inventory",
|
||||
ex.Message
|
||||
)
|
||||
@@ -341,7 +341,10 @@ public class InventoryHelper(
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("inventory-fill_container_failed", ex.Message)
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-fill_container_failed",
|
||||
ex.Message
|
||||
)
|
||||
);
|
||||
|
||||
return;
|
||||
@@ -466,7 +469,7 @@ public class InventoryHelper(
|
||||
{
|
||||
_httpResponseUtil.AppendErrorToOutput(
|
||||
output,
|
||||
_localisationService.GetText("inventory-no_stash_space"),
|
||||
_serverLocalisationService.GetText("inventory-no_stash_space"),
|
||||
BackendErrorCodes.NotEnoughSpace
|
||||
);
|
||||
}
|
||||
@@ -474,11 +477,13 @@ public class InventoryHelper(
|
||||
|
||||
protected void HandleContainerPlacementError(string errorText, ItemEventRouterResponse output)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("inventory-fill_container_failed", errorText));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("inventory-fill_container_failed", errorText)
|
||||
);
|
||||
|
||||
_httpResponseUtil.AppendErrorToOutput(
|
||||
output,
|
||||
_localisationService.GetText("inventory-no_stash_space")
|
||||
_serverLocalisationService.GetText("inventory-no_stash_space")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -501,7 +506,7 @@ public class InventoryHelper(
|
||||
if (itemId is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("inventory-unable_to_remove_item_no_id_given")
|
||||
_serverLocalisationService.GetText("inventory-unable_to_remove_item_no_id_given")
|
||||
);
|
||||
|
||||
return;
|
||||
@@ -514,7 +519,7 @@ public class InventoryHelper(
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-unable_to_remove_item_id_not_found",
|
||||
new { ChildId = itemId, ProfileId = profile.Id }
|
||||
)
|
||||
@@ -547,7 +552,7 @@ public class InventoryHelper(
|
||||
else
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-unable_to_remove_item_id_not_found",
|
||||
new { childId = item.Id, ProfileId = profile.Id }
|
||||
)
|
||||
@@ -598,7 +603,7 @@ public class InventoryHelper(
|
||||
if (indexOfItemToRemove == -1)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-unable_to_remove_item_restart_immediately",
|
||||
new
|
||||
{
|
||||
@@ -709,14 +714,17 @@ public class InventoryHelper(
|
||||
if (!isValidItem)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("inventory-invalid_item_missing_from_db", itemTpl)
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-invalid_item_missing_from_db",
|
||||
itemTpl
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Item found but no _props property
|
||||
if (isValidItem && itemTemplate.Properties is null)
|
||||
{
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-item_missing_props_property",
|
||||
new { itemTpl, itemName = itemTemplate?.Name }
|
||||
);
|
||||
@@ -726,7 +734,9 @@ public class InventoryHelper(
|
||||
if (!isValidItem && itemTemplate is null)
|
||||
{
|
||||
// return default size of 1x1
|
||||
_logger.Error(_localisationService.GetText("inventory-return_default_size", itemTpl));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("inventory-return_default_size", itemTpl)
|
||||
);
|
||||
|
||||
return [1, 1]; // Invalid input data, return defaults
|
||||
}
|
||||
@@ -796,7 +806,7 @@ public class InventoryHelper(
|
||||
if (!isValid)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-get_item_size_item_not_found_by_tpl",
|
||||
childItem.Template
|
||||
)
|
||||
@@ -939,7 +949,7 @@ public class InventoryHelper(
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-unable_to_fill_container",
|
||||
new { id = item.Id, error = $"{ex.Message} {ex.StackTrace}" }
|
||||
)
|
||||
@@ -1103,13 +1113,15 @@ public class InventoryHelper(
|
||||
var stashTPL = GetStashType(sessionId);
|
||||
if (stashTPL is null)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("inventory-missing_stash_size"));
|
||||
_logger.Error(_serverLocalisationService.GetText("inventory-missing_stash_size"));
|
||||
}
|
||||
|
||||
var stashItemResult = _itemHelper.GetItem(stashTPL);
|
||||
if (!stashItemResult.Key)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("inventory-stash_not_found", stashTPL));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("inventory-stash_not_found", stashTPL)
|
||||
);
|
||||
|
||||
return new List<int>();
|
||||
}
|
||||
@@ -1142,7 +1154,7 @@ public class InventoryHelper(
|
||||
);
|
||||
if (stashObj is null)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("inventory-unable_to_find_stash"));
|
||||
_logger.Error(_serverLocalisationService.GetText("inventory-unable_to_find_stash"));
|
||||
}
|
||||
|
||||
return stashObj?.Template;
|
||||
@@ -1170,7 +1182,10 @@ public class InventoryHelper(
|
||||
if (itemToMove is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("inventory-unable_to_find_item_to_move", itemId)
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-unable_to_find_item_to_move",
|
||||
itemId
|
||||
)
|
||||
);
|
||||
continue;
|
||||
}
|
||||
@@ -1244,7 +1259,7 @@ public class InventoryHelper(
|
||||
)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inventory-invalid_move_to_container",
|
||||
new
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ public class ItemHelper(
|
||||
HandbookHelper _handbookHelper,
|
||||
ItemBaseClassService _itemBaseClassService,
|
||||
ItemFilterService _itemFilterService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
LocaleService _localeService,
|
||||
ICloner _cloner
|
||||
)
|
||||
@@ -700,7 +700,7 @@ public class ItemHelper(
|
||||
if (durability == 0)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"item-durability_value_invalid_use_default",
|
||||
item.Template
|
||||
)
|
||||
@@ -1565,7 +1565,9 @@ public class ItemHelper(
|
||||
var cartridgeDetails = GetItem(cartridgeTpl);
|
||||
if (!cartridgeDetails.Key)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("item-invalid_tpl_item", cartridgeTpl));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("item-invalid_tpl_item", cartridgeTpl)
|
||||
);
|
||||
}
|
||||
|
||||
var cartridgeMaxStackSize = cartridgeDetails.Value?.Properties?.StackMaxSize;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ProfileHelper(
|
||||
DatabaseService _databaseService,
|
||||
Watermark _watermark,
|
||||
TimeUtil _timeUtil,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
HashUtil _hashUtil,
|
||||
ConfigServer _configServer
|
||||
)
|
||||
@@ -486,7 +486,7 @@ public class ProfileHelper(
|
||||
var profileSkill = profileSkills.FirstOrDefault(s => s.Id == skill);
|
||||
if (profileSkill == null)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("quest-no_skill_found", skill));
|
||||
_logger.Error(_serverLocalisationService.GetText("quest-no_skill_found", skill));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -510,7 +510,7 @@ public class ProfileHelper(
|
||||
if (pointsToAddToSkill < 0D)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"player-attempt_to_increment_skill_with_negative_value",
|
||||
skill
|
||||
)
|
||||
@@ -530,7 +530,7 @@ public class ProfileHelper(
|
||||
var profileSkill = profileSkills.FirstOrDefault(s => s.Id == skill);
|
||||
if (profileSkill == null)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("quest-no_skill_found", skill));
|
||||
_logger.Error(_serverLocalisationService.GetText("quest-no_skill_found", skill));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class QuestHelper(
|
||||
ProfileHelper _profileHelper,
|
||||
QuestRewardHelper _questRewardHelper,
|
||||
RewardHelper _rewardHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
SeasonalEventService _seasonalEventService,
|
||||
MailSendService _mailSendService,
|
||||
ConfigServer _configServer,
|
||||
@@ -98,7 +98,7 @@ public class QuestHelper(
|
||||
return playerLevel == conditionValue;
|
||||
default:
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"quest-unable_to_find_compare_condition",
|
||||
condition.CompareMethod
|
||||
)
|
||||
@@ -218,7 +218,7 @@ public class QuestHelper(
|
||||
)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"quest-unable_to_find_trader_in_profile",
|
||||
questProperties.Target
|
||||
)
|
||||
@@ -251,7 +251,7 @@ public class QuestHelper(
|
||||
)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"quest-unable_to_find_trader_in_profile",
|
||||
questProperties.Target
|
||||
)
|
||||
@@ -291,7 +291,10 @@ public class QuestHelper(
|
||||
|
||||
default:
|
||||
_logger.Error(
|
||||
_localisationService.GetText("quest-compare_operator_unhandled", compareMethod)
|
||||
_serverLocalisationService.GetText(
|
||||
"quest-compare_operator_unhandled",
|
||||
compareMethod
|
||||
)
|
||||
);
|
||||
|
||||
return false;
|
||||
@@ -350,7 +353,7 @@ public class QuestHelper(
|
||||
if (questDbData is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"quest-unable_to_find_quest_in_db",
|
||||
new { questId = acceptedQuest.QuestId, questType = acceptedQuest.Type }
|
||||
)
|
||||
@@ -644,7 +647,7 @@ public class QuestHelper(
|
||||
if (inventoryItemIndex < 0)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("quest-item_not_found_in_inventory", itemId)
|
||||
_serverLocalisationService.GetText("quest-item_not_found_in_inventory", itemId)
|
||||
);
|
||||
|
||||
return;
|
||||
@@ -776,7 +779,7 @@ public class QuestHelper(
|
||||
if (!SellToTraderQuestConditionCache.TryGetValue(counter.SourceId, out var conditions))
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"quest_unable_to_find_quest_in_db_no_type",
|
||||
counter.SourceId
|
||||
)
|
||||
@@ -820,7 +823,7 @@ public class QuestHelper(
|
||||
if (itemDetails is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"trader-unable_to_find_inventory_item_for_selltotrader_counter",
|
||||
taskCounter.SourceId
|
||||
)
|
||||
@@ -1674,7 +1677,7 @@ public class QuestHelper(
|
||||
if (repeatableInScavProfile is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"quest-unable_to_remove_scav_quest_from_profile",
|
||||
new { scavQuestId = questIdToRemove, profileId = sessionId }
|
||||
)
|
||||
|
||||
@@ -18,7 +18,7 @@ public class QuestRewardHelper(
|
||||
DatabaseService _databaseService,
|
||||
ProfileHelper _profileHelper,
|
||||
RewardHelper _rewardHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ICloner _cloner
|
||||
)
|
||||
{
|
||||
@@ -62,7 +62,7 @@ public class QuestRewardHelper(
|
||||
if (questDetails is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"quest-unable_to_find_quest_in_db_no_quest_rewards",
|
||||
questId
|
||||
)
|
||||
|
||||
@@ -33,7 +33,7 @@ public class RagfairOfferHelper(
|
||||
DatabaseService _databaseService,
|
||||
RagfairOfferService _ragfairOfferService,
|
||||
LocaleService _localeService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
MailSendService _mailSendService,
|
||||
RagfairRequiredItemsService _ragfairRequiredItemsService,
|
||||
ProfileHelper _profileHelper,
|
||||
@@ -888,7 +888,7 @@ public class RagfairOfferHelper(
|
||||
if (!globalLocales.TryGetValue(_goodSoldTemplate, out var soldMessageLocaleGuid))
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"ragfair-unable_to_find_locale_by_key",
|
||||
_goodSoldTemplate
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@ public class RagfairServerHelper(
|
||||
TraderHelper traderHelper,
|
||||
WeightedRandomHelper weightedRandomHelper,
|
||||
MailSendService mailSendService,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
ConfigServer configServer,
|
||||
ICloner cloner
|
||||
)
|
||||
|
||||
@@ -21,11 +21,10 @@ public class RewardHelper(
|
||||
ItemHelper _itemHelper,
|
||||
DatabaseService _databaseService,
|
||||
ProfileHelper _profileHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
TraderHelper _traderHelper,
|
||||
PresetHelper _presetHelper,
|
||||
ICloner _cloner,
|
||||
PlayerService _playerService
|
||||
ICloner _cloner
|
||||
)
|
||||
{
|
||||
/// <summary>
|
||||
@@ -129,7 +128,7 @@ public class RewardHelper(
|
||||
break;
|
||||
default:
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"reward-type_not_handled",
|
||||
new { rewardType = reward.Type, questId = rewardSourceId }
|
||||
)
|
||||
@@ -192,7 +191,7 @@ public class RewardHelper(
|
||||
if (matchingProductions.Count != 1)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"reward-unable_to_find_matching_hideout_production",
|
||||
new { questId, matchCount = matchingProductions.Count }
|
||||
)
|
||||
|
||||
@@ -25,7 +25,7 @@ public class TradeHelper(
|
||||
QuestHelper _questHelper,
|
||||
PaymentService _paymentService,
|
||||
FenceService _fenceService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
HttpResponseUtil _httpResponseUtil,
|
||||
InventoryHelper _inventoryHelper,
|
||||
RagfairServer _ragfairServer,
|
||||
@@ -146,7 +146,9 @@ public class TradeHelper(
|
||||
);
|
||||
}
|
||||
|
||||
var message = _localisationService.GetText("ragfair-offer_no_longer_exists");
|
||||
var message = _serverLocalisationService.GetText(
|
||||
"ragfair-offer_no_longer_exists"
|
||||
);
|
||||
_httpResponseUtil.AppendErrorToOutput(output, message);
|
||||
|
||||
return;
|
||||
|
||||
@@ -21,8 +21,7 @@ public class TraderHelper(
|
||||
ProfileHelper _profileHelper,
|
||||
HandbookHelper _handbookHelper,
|
||||
ItemHelper _itemHelper,
|
||||
PlayerService _playerService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
FenceService _fenceService,
|
||||
TraderStore _traderStore,
|
||||
TimeUtil _timeUtil,
|
||||
@@ -67,7 +66,10 @@ public class TraderHelper(
|
||||
if (pmcData == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText("trader-unable_to_find_profile_with_id", sessionID)
|
||||
_serverLocalisationService.GetText(
|
||||
"trader-unable_to_find_profile_with_id",
|
||||
sessionID
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -83,7 +85,7 @@ public class TraderHelper(
|
||||
if (traderBase == null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("trader-unable_to_find_trader_by_id", traderID)
|
||||
_serverLocalisationService.GetText("trader-unable_to_find_trader_by_id", traderID)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -151,7 +153,7 @@ public class TraderHelper(
|
||||
if (fullProfile is null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText("trader-unable_to_find_profile_by_id", sessionID)
|
||||
_serverLocalisationService.GetText("trader-unable_to_find_profile_by_id", sessionID)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -388,7 +390,7 @@ public class TraderHelper(
|
||||
if (traderDetails?.Seconds?.Min is null || traderDetails.Seconds?.Max is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"trader-missing_trader_details_using_default_refresh_time",
|
||||
new { traderId, updateTime = _traderConfig.UpdateTimeDefault }
|
||||
)
|
||||
@@ -486,7 +488,7 @@ public class TraderHelper(
|
||||
)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"trader-unable_to_purchase_item_limit_reached",
|
||||
new { traderId, limit = itemPurchased.Upd.BuyRestrictionMax }
|
||||
)
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace SPTarkov.Server.Core.Helpers;
|
||||
[Injectable]
|
||||
public class WeightedRandomHelper(
|
||||
ISptLogger<WeightedRandomHelper> _logger,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
RandomUtil _randomUtil
|
||||
)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ public class ItemEventRouter(
|
||||
ISptLogger<FileLogger> fileLogger,
|
||||
JsonUtil jsonUtil,
|
||||
ProfileHelper profileHelper,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
EventOutputHolder eventOutputHolder,
|
||||
IEnumerable<ItemEventRouterDefinition> itemEventRouters,
|
||||
ICloner cloner
|
||||
|
||||
@@ -20,7 +20,7 @@ public class SptHttpListener(
|
||||
ISptLogger<RequestLogger> _requestsLogger,
|
||||
JsonUtil _jsonUtil,
|
||||
HttpResponseUtil _httpResponseUtil,
|
||||
LocalisationService _localisationService
|
||||
ServerLocalisationService _serverLocalisationService
|
||||
) : IHttpListener
|
||||
{
|
||||
// We want to read 1KB at a time, for most request this is already big enough
|
||||
@@ -108,7 +108,9 @@ public class SptHttpListener(
|
||||
|
||||
default:
|
||||
{
|
||||
_logger.Warning($"{_localisationService.GetText("unknown_request")}: {req.Method}");
|
||||
_logger.Warning(
|
||||
$"{_serverLocalisationService.GetText("unknown_request")}: {req.Method}"
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -195,7 +197,9 @@ public class SptHttpListener(
|
||||
/* route doesn't exist or response is not properly set up */
|
||||
if (string.IsNullOrEmpty(output))
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("unhandled_response", req.Path.ToString()));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("unhandled_response", req.Path.ToString())
|
||||
);
|
||||
output = _httpResponseUtil.GetBody<object?>(
|
||||
null,
|
||||
BackendErrorCodes.HTTPNotFound,
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace SPTarkov.Server.Core.Servers;
|
||||
public class HttpServer(
|
||||
WebApplicationBuilder _builder,
|
||||
ISptLogger<HttpServer> _logger,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ConfigServer _configServer,
|
||||
CertificateHelper _certificateHelper,
|
||||
WebSocketServer _webSocketServer,
|
||||
@@ -148,13 +148,13 @@ public class HttpServer(
|
||||
if (isLocalRequest)
|
||||
{
|
||||
_logger.Info(
|
||||
_localisationService.GetText("client_request", context.Request.Path.Value)
|
||||
_serverLocalisationService.GetText("client_request", context.Request.Path.Value)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Info(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"client_request_ip",
|
||||
new { ip = clientIp, url = context.Request.Path.Value }
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ public class RagfairServer(
|
||||
RagfairOfferService _ragfairOfferService,
|
||||
RagfairCategoriesService _ragfairCategoriesService,
|
||||
RagfairRequiredItemsService _ragfairRequiredItemsService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
RagfairOfferGenerator _ragfairOfferGenerator,
|
||||
RagfairOfferHolder _ragfairOfferHolder,
|
||||
ConfigServer _configServer,
|
||||
@@ -28,7 +28,7 @@ public class RagfairServer(
|
||||
|
||||
public void Load()
|
||||
{
|
||||
_logger.Info(_localisationService.GetText("ragfair-generating_offers"));
|
||||
_logger.Info(_serverLocalisationService.GetText("ragfair-generating_offers"));
|
||||
_ragfairOfferGenerator.GenerateDynamicOffers();
|
||||
Update();
|
||||
}
|
||||
@@ -106,7 +106,10 @@ public class RagfairServer(
|
||||
if (offer is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("ragfair-offer_not_found_unable_to_hide", offerId)
|
||||
_serverLocalisationService.GetText(
|
||||
"ragfair-offer_not_found_unable_to_hide",
|
||||
offerId
|
||||
)
|
||||
);
|
||||
|
||||
return;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class SaveServer(
|
||||
IEnumerable<SaveLoadRouter> _saveLoadRouters,
|
||||
JsonUtil _jsonUtil,
|
||||
HashUtil _hashUtil,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ISptLogger<SaveServer> _logger,
|
||||
ConfigServer _configServer
|
||||
)
|
||||
@@ -241,7 +241,7 @@ public class SaveServer(
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"profile_save_callback_error",
|
||||
new { callback, error = e }
|
||||
)
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace SPTarkov.Server.Core.Servers.Ws;
|
||||
[Injectable(InjectionType.Singleton)]
|
||||
public class SptWebSocketConnectionHandler(
|
||||
ISptLogger<SptWebSocketConnectionHandler> _logger,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
JsonUtil _jsonUtil,
|
||||
ProfileHelper _profileHelper,
|
||||
IEnumerable<ISptWebSocketMessageHandler> _messageHandlers
|
||||
@@ -55,7 +55,7 @@ public class SptWebSocketConnectionHandler(
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"websocket-player_reconnect",
|
||||
new { sessionId = playerInfoText, contextId = sessionIdContext }
|
||||
)
|
||||
@@ -73,7 +73,7 @@ public class SptWebSocketConnectionHandler(
|
||||
if (_logger.IsLogEnabled(LogLevel.Info))
|
||||
{
|
||||
_logger.Info(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"websocket-player_connected",
|
||||
new { sessionId = playerInfoText, contextId = sessionIdContext }
|
||||
)
|
||||
@@ -200,7 +200,7 @@ public class SptWebSocketConnectionHandler(
|
||||
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug(_localisationService.GetText("websocket-message_sent"));
|
||||
_logger.Debug(_serverLocalisationService.GetText("websocket-message_sent"));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -208,7 +208,7 @@ public class SptWebSocketConnectionHandler(
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"websocket-not_ready_message_not_sent",
|
||||
sessionID
|
||||
)
|
||||
@@ -219,7 +219,7 @@ public class SptWebSocketConnectionHandler(
|
||||
catch (Exception err)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("websocket-message_send_failed_with_error"),
|
||||
_serverLocalisationService.GetText("websocket-message_send_failed_with_error"),
|
||||
err
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public class AirdropService(
|
||||
HashUtil _hashUtil,
|
||||
WeightedRandomHelper _weightedRandomHelper,
|
||||
ContainerHelper _containerHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ItemFilterService _itemFilterService,
|
||||
ItemHelper _itemHelper
|
||||
)
|
||||
@@ -42,7 +42,7 @@ public class AirdropService(
|
||||
}
|
||||
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"airdrop-unable_to_find_container_id_generating_random",
|
||||
request.ContainerId
|
||||
)
|
||||
@@ -234,7 +234,7 @@ public class AirdropService(
|
||||
if (!_airdropConfig.Loot.TryGetValue(airdropType.ToString(), out var lootSettingsByType))
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-unable_to_find_airdrop_drop_config_of_type",
|
||||
airdropType
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@ public class BotEquipmentModPoolService(
|
||||
ISptLogger<BotEquipmentModPoolService> logger,
|
||||
ItemHelper itemHelper,
|
||||
DatabaseService databaseService,
|
||||
LocalisationService localisationService
|
||||
ServerLocalisationService localisationService
|
||||
)
|
||||
{
|
||||
private readonly Lock _lockObject = new();
|
||||
|
||||
@@ -9,10 +9,10 @@ namespace SPTarkov.Server.Core.Services;
|
||||
[Injectable(InjectionType.Singleton)]
|
||||
public class BotGenerationCacheService(
|
||||
ISptLogger<BotGenerationCacheService> _logger,
|
||||
LocalisationService _localisationService
|
||||
ServerLocalisationService _serverLocalisationService
|
||||
)
|
||||
{
|
||||
protected readonly Queue<BotBase> _activeBotsInRaid = [];
|
||||
protected Queue<BotBase> _activeBotsInRaid = [];
|
||||
protected readonly ConcurrentDictionary<string, List<BotBase>> _storedBots = new();
|
||||
|
||||
/// <summary>
|
||||
@@ -50,7 +50,7 @@ public class BotGenerationCacheService(
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-cache_has_zero_bots_of_requested_type",
|
||||
key
|
||||
)
|
||||
@@ -60,13 +60,13 @@ public class BotGenerationCacheService(
|
||||
}
|
||||
|
||||
_logger.Error(
|
||||
_localisationService.GetText("bot-cache_has_zero_bots_of_requested_type", key)
|
||||
_serverLocalisationService.GetText("bot-cache_has_zero_bots_of_requested_type", key)
|
||||
);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
_logger.Warning(_localisationService.GetText("bot-no_bot_type_in_cache", key));
|
||||
_logger.Warning(_serverLocalisationService.GetText("bot-no_bot_type_in_cache", key));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class BotLootCacheService(
|
||||
ISptLogger<BotLootCacheService> _logger,
|
||||
ItemHelper _itemHelper,
|
||||
PMCLootGenerator _pmcLootGenerator,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ICloner _cloner
|
||||
)
|
||||
{
|
||||
@@ -112,7 +112,7 @@ public class BotLootCacheService(
|
||||
break;
|
||||
default:
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-loot_type_not_found",
|
||||
new
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ public class BotNameService(
|
||||
ISptLogger<BotNameService> _logger,
|
||||
BotHelper _botHelper,
|
||||
RandomUtil _randomUtil,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
DatabaseService _databaseService,
|
||||
ConfigServer _configServer
|
||||
)
|
||||
@@ -80,7 +80,7 @@ public class BotNameService(
|
||||
&& botGenerationDetails.AllPmcsHaveSameNameAsPlayer.GetValueOrDefault(false)
|
||||
)
|
||||
{
|
||||
var prefix = _localisationService.GetRandomTextThatMatchesPartialKey(
|
||||
var prefix = _serverLocalisationService.GetRandomTextThatMatchesPartialKey(
|
||||
"pmc-name_prefix_"
|
||||
);
|
||||
name = $"{prefix} {name}";
|
||||
|
||||
@@ -21,7 +21,7 @@ public class BtrDeliveryService(
|
||||
SaveServer _saveServer,
|
||||
MailSendService _mailSendService,
|
||||
ConfigServer _configServer,
|
||||
LocalisationService _localisationService
|
||||
ServerLocalisationService _serverLocalisationService
|
||||
)
|
||||
{
|
||||
protected readonly BtrDeliveryConfig _btrDeliveryConfig =
|
||||
@@ -95,7 +95,7 @@ public class BtrDeliveryService(
|
||||
if (dialogueTemplates is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inraid-unable_to_deliver_item_no_trader_found",
|
||||
Traders.BTR
|
||||
)
|
||||
@@ -106,7 +106,7 @@ public class BtrDeliveryService(
|
||||
if (!dialogueTemplates.TryGetValue("itemsDelivered", out var itemsDelivered))
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"btr-unable_to_find_items_in_dialog_template",
|
||||
sessionId
|
||||
)
|
||||
|
||||
@@ -38,7 +38,7 @@ public class CircleOfCultistService(
|
||||
DatabaseService _databaseService,
|
||||
ItemFilterService _itemFilterService,
|
||||
SeasonalEventService _seasonalEventService,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
ConfigServer _configServer
|
||||
)
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ public class CreateProfileService(
|
||||
TimeUtil _timeUtil,
|
||||
HashUtil _hashUtil,
|
||||
DatabaseService _databaseService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ProfileHelper _profileHelper,
|
||||
ItemHelper _itemHelper,
|
||||
TraderHelper _traderHelper,
|
||||
@@ -240,7 +240,7 @@ public class CreateProfileService(
|
||||
else
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"profile-unable_to_find_profile_by_id_cannot_delete",
|
||||
sessionID
|
||||
)
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace SPTarkov.Server.Core.Services;
|
||||
public class DatabaseService(
|
||||
ISptLogger<DatabaseService> _logger,
|
||||
DatabaseServer _databaseServer,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
HashUtil _hashUtil
|
||||
)
|
||||
{
|
||||
@@ -40,7 +40,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Bots == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/bots"
|
||||
)
|
||||
@@ -56,7 +56,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Globals == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/globals.json"
|
||||
)
|
||||
@@ -72,7 +72,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Hideout == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/hideout"
|
||||
)
|
||||
@@ -88,7 +88,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Locales == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/locales"
|
||||
)
|
||||
@@ -104,7 +104,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Locations == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/locations"
|
||||
)
|
||||
@@ -125,7 +125,7 @@ public class DatabaseService(
|
||||
if (desiredLocation == null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("database-no_location_found_with_id", locationId)
|
||||
_serverLocalisationService.GetText("database-no_location_found_with_id", locationId)
|
||||
);
|
||||
|
||||
return null;
|
||||
@@ -140,7 +140,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Match == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/locales"
|
||||
)
|
||||
@@ -156,7 +156,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Server == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/server.json"
|
||||
)
|
||||
@@ -172,7 +172,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Settings == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/settings.json"
|
||||
)
|
||||
@@ -188,7 +188,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Templates == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/templates"
|
||||
)
|
||||
@@ -204,7 +204,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Templates?.Achievements == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/templates/achievements.json"
|
||||
)
|
||||
@@ -220,7 +220,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Templates?.Achievements == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/templates/customAchievements.json"
|
||||
)
|
||||
@@ -236,7 +236,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Templates?.Customization == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/templates/customization.json"
|
||||
)
|
||||
@@ -252,7 +252,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Templates?.Handbook == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/templates/handbook.json"
|
||||
)
|
||||
@@ -268,7 +268,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Templates?.Items == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/templates/items.json"
|
||||
)
|
||||
@@ -284,7 +284,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Templates?.Prices == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/templates/prices.json"
|
||||
)
|
||||
@@ -300,7 +300,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Templates?.Profiles == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/templates/profiles.json"
|
||||
)
|
||||
@@ -316,7 +316,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Templates?.Quests == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/templates/quests.json"
|
||||
)
|
||||
@@ -332,7 +332,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Traders == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/traders"
|
||||
)
|
||||
@@ -353,7 +353,7 @@ public class DatabaseService(
|
||||
if (!traders.TryGetValue(traderId, out var desiredTrader))
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("database-no_trader_found_with_id", traderId)
|
||||
_serverLocalisationService.GetText("database-no_trader_found_with_id", traderId)
|
||||
);
|
||||
|
||||
return null;
|
||||
@@ -368,7 +368,7 @@ public class DatabaseService(
|
||||
if (_databaseServer.GetTables().Templates?.LocationServices == null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"database-data_at_path_missing",
|
||||
"assets/database/locationServices.json"
|
||||
)
|
||||
@@ -393,7 +393,7 @@ public class DatabaseService(
|
||||
|
||||
if (!_isDataValid)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("database-invalid_data"));
|
||||
_logger.Error(_serverLocalisationService.GetText("database-invalid_data"));
|
||||
}
|
||||
|
||||
start.Stop();
|
||||
|
||||
@@ -24,7 +24,7 @@ public class FenceService(
|
||||
HandbookHelper handbookHelper,
|
||||
ItemHelper itemHelper,
|
||||
PresetHelper presetHelper,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
ConfigServer configServer,
|
||||
ICloner _cloner
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace SPTarkov.Server.Core.Services;
|
||||
public class GiftService(
|
||||
ISptLogger<GiftService> _logger,
|
||||
MailSendService _mailSendService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
HashUtil _hashUtil,
|
||||
TimeUtil _timeUtil,
|
||||
ProfileHelper _profileHelper,
|
||||
@@ -224,7 +224,7 @@ public class GiftService(
|
||||
return MessageType.UserMessage;
|
||||
default:
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"gift-unable_to_handle_message_type_command",
|
||||
giftData.Sender
|
||||
)
|
||||
|
||||
@@ -1,170 +0,0 @@
|
||||
using SPTarkov.Common.Extensions;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
using SPTarkov.Server.Core.Utils.Json;
|
||||
|
||||
namespace SPTarkov.Server.Core.Services;
|
||||
|
||||
public class I18nService
|
||||
{
|
||||
private readonly string _defaultLocale;
|
||||
private readonly string _directory;
|
||||
private readonly Dictionary<string, string> _fallbacks;
|
||||
private readonly FileUtil _fileUtil;
|
||||
private readonly JsonUtil _jsonUtil;
|
||||
|
||||
private readonly Dictionary<string, LazyLoad<Dictionary<string, string>>> _loadedLocales =
|
||||
new();
|
||||
private readonly LocaleService _localeService;
|
||||
private HashSet<string> _locales;
|
||||
private string? _setLocale;
|
||||
|
||||
public I18nService(
|
||||
FileUtil fileUtil,
|
||||
JsonUtil jsonUtil,
|
||||
HashSet<string> locales,
|
||||
Dictionary<string, string> fallbacks,
|
||||
string defaultLocale,
|
||||
string directory,
|
||||
LocaleService localeService
|
||||
)
|
||||
{
|
||||
_locales = locales;
|
||||
_fallbacks = fallbacks;
|
||||
_defaultLocale = defaultLocale;
|
||||
_directory = directory;
|
||||
_jsonUtil = jsonUtil;
|
||||
_fileUtil = fileUtil;
|
||||
_localeService = localeService;
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
var files = _fileUtil
|
||||
.GetFiles(_directory, true)
|
||||
.Where(f => _fileUtil.GetFileExtension(f) == "json")
|
||||
.ToList();
|
||||
if (files.Count == 0)
|
||||
{
|
||||
throw new Exception($"Localisation files in directory {_directory} not found.");
|
||||
}
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
_loadedLocales.Add(
|
||||
_fileUtil.StripExtension(file),
|
||||
new LazyLoad<Dictionary<string, string>>(() =>
|
||||
_jsonUtil.DeserializeFromFile<Dictionary<string, string>>(file)
|
||||
?? new Dictionary<string, string>()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (!_loadedLocales.ContainsKey(_defaultLocale))
|
||||
{
|
||||
throw new Exception(
|
||||
$"The default locale '{_defaultLocale}' does not exist on the loaded locales."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetLocaleByKey(string locale)
|
||||
{
|
||||
if (_loadedLocales.ContainsKey(locale))
|
||||
{
|
||||
_setLocale = locale;
|
||||
}
|
||||
else
|
||||
{
|
||||
var fallback = _fallbacks.Where(kv => locale.StartsWith(kv.Key.Replace("*", "")));
|
||||
if (fallback.Any())
|
||||
{
|
||||
var foundFallbackLocale = fallback.First().Value;
|
||||
if (!_loadedLocales.ContainsKey(foundFallbackLocale))
|
||||
{
|
||||
throw new Exception(
|
||||
$"Locale '{locale}' was not defined, and the found fallback locale did not match any of the loaded locales."
|
||||
);
|
||||
}
|
||||
|
||||
_setLocale = foundFallbackLocale;
|
||||
}
|
||||
|
||||
_setLocale = _defaultLocale;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetLocalisedValue(string key)
|
||||
{
|
||||
// get loaded locales for set key
|
||||
if (!_loadedLocales.TryGetValue(_setLocale, out var locales))
|
||||
{
|
||||
// if we are unable to get the "loadedLocales" for the set locale, return the key
|
||||
return key;
|
||||
}
|
||||
|
||||
// searching through loaded locales for given key
|
||||
if (!locales.Value.TryGetValue(key, out var value))
|
||||
{
|
||||
// if the key is not found in loaded locales
|
||||
// check if the key is found in the default locale
|
||||
_loadedLocales.TryGetValue(_defaultLocale, out var defaults);
|
||||
if (!defaults.Value.TryGetValue(key, out value))
|
||||
{
|
||||
value = _localeService
|
||||
.GetLocaleDb(_defaultLocale)
|
||||
.FirstOrDefault(x => x.Key == key)
|
||||
.Value;
|
||||
}
|
||||
|
||||
return value ?? key;
|
||||
}
|
||||
|
||||
// if the key is found in the server locale, return the value
|
||||
return value;
|
||||
}
|
||||
|
||||
public string GetLocalised<T>(string key)
|
||||
{
|
||||
return GetLocalisedValue(key);
|
||||
}
|
||||
|
||||
public string GetLocalised(string key, object? args)
|
||||
{
|
||||
var rawLocalizedString = GetLocalisedValue(key);
|
||||
if (args == null)
|
||||
{
|
||||
return rawLocalizedString;
|
||||
}
|
||||
|
||||
var typeToCheck = args.GetType();
|
||||
var typeProps = typeToCheck.GetProperties();
|
||||
|
||||
foreach (var propertyInfo in args.GetType().GetProperties())
|
||||
{
|
||||
var localizedName = $"{{{{{propertyInfo.GetJsonName()}}}}}";
|
||||
if (rawLocalizedString.Contains(localizedName))
|
||||
{
|
||||
rawLocalizedString = rawLocalizedString.Replace(
|
||||
localizedName,
|
||||
propertyInfo.GetValue(args)?.ToString() ?? string.Empty
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return rawLocalizedString;
|
||||
}
|
||||
|
||||
public string GetLocalised<T>(string key, T? value)
|
||||
where T : IConvertible
|
||||
{
|
||||
var rawLocalizedString = GetLocalisedValue(key);
|
||||
return rawLocalizedString.Replace("%s", value?.ToString());
|
||||
}
|
||||
|
||||
public List<string> GetLocalisedKeys()
|
||||
{
|
||||
return _loadedLocales["en"].Value?.Keys.ToList()!;
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class InsuranceService(
|
||||
SaveServer _saveServer,
|
||||
TraderHelper _traderHelper,
|
||||
ProfileHelper _profileHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
MailSendService _mailSendService,
|
||||
ConfigServer _configServer,
|
||||
ICloner _cloner
|
||||
@@ -81,7 +81,7 @@ public class InsuranceService(
|
||||
if (traderBase is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"insurance-unable_to_find_trader_by_id",
|
||||
traderKvP.Key
|
||||
)
|
||||
@@ -94,7 +94,7 @@ public class InsuranceService(
|
||||
if (dialogueTemplates is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"insurance-trader_lacks_dialogue_property",
|
||||
traderKvP.Key
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace SPTarkov.Server.Core.Services;
|
||||
public class ItemBaseClassService(
|
||||
ISptLogger<ItemBaseClassService> _logger,
|
||||
DatabaseService _databaseService,
|
||||
LocalisationService _localisationService
|
||||
ServerLocalisationService _serverLocalisationService
|
||||
)
|
||||
{
|
||||
private bool _cacheGenerated;
|
||||
@@ -95,7 +95,7 @@ public class ItemBaseClassService(
|
||||
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug(_localisationService.GetText("baseclass-item_not_found", itemTpl));
|
||||
_logger.Debug(_serverLocalisationService.GetText("baseclass-item_not_found", itemTpl));
|
||||
}
|
||||
|
||||
// Not found in cache, Hydrate again - some mods add items late
|
||||
@@ -107,7 +107,9 @@ public class ItemBaseClassService(
|
||||
return value.Any(baseClasses.Contains);
|
||||
}
|
||||
|
||||
_logger.Warning(_localisationService.GetText("baseclass-item_not_found_failed", itemTpl));
|
||||
_logger.Warning(
|
||||
_serverLocalisationService.GetText("baseclass-item_not_found_failed", itemTpl)
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Models.Utils;
|
||||
using SPTarkov.Server.Core.Servers;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
|
||||
namespace SPTarkov.Server.Core.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Handles translating server text into different langauges
|
||||
/// </summary>
|
||||
[Injectable(InjectionType.Singleton)]
|
||||
public class LocalisationService
|
||||
{
|
||||
protected DatabaseServer _databaseServer;
|
||||
|
||||
protected I18nService _i18nService;
|
||||
protected LocaleService _localeService;
|
||||
protected ISptLogger<LocalisationService> _logger;
|
||||
protected RandomUtil _randomUtil;
|
||||
|
||||
// TODO: turn into primary ctor
|
||||
public LocalisationService(
|
||||
ISptLogger<LocalisationService> logger,
|
||||
RandomUtil randomUtil,
|
||||
DatabaseServer databaseServer,
|
||||
LocaleService localeService,
|
||||
JsonUtil jsonUtil,
|
||||
FileUtil fileUtil
|
||||
)
|
||||
{
|
||||
_logger = logger;
|
||||
_randomUtil = randomUtil;
|
||||
_databaseServer = databaseServer;
|
||||
_localeService = localeService;
|
||||
_i18nService = new I18nService(
|
||||
fileUtil,
|
||||
jsonUtil,
|
||||
localeService.GetServerSupportedLocales().ToHashSet(),
|
||||
localeService.GetLocaleFallbacks(),
|
||||
"en",
|
||||
"./SPT_Data/database/locales/server",
|
||||
localeService
|
||||
);
|
||||
_i18nService.SetLocaleByKey(localeService.GetDesiredServerLocale());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a localised value using the passed in key
|
||||
/// </summary>
|
||||
/// <param name="key"> Key to look up locale for </param>
|
||||
/// <param name="args"> optional arguments </param>
|
||||
/// <returns> Localised string </returns>
|
||||
public string GetText(string key, object? args = null)
|
||||
{
|
||||
return args is null
|
||||
? _i18nService.GetLocalisedValue(key)
|
||||
: _i18nService.GetLocalised(key, args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a localised value using the passed in key
|
||||
/// </summary>
|
||||
/// <param name="key"> Key to look up locale for </param>
|
||||
/// <param name="value"> Value to localize </param>
|
||||
/// <returns> Localised string </returns>
|
||||
public string GetText<T>(string key, T value)
|
||||
where T : IConvertible?
|
||||
{
|
||||
return _i18nService.GetLocalised(key, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get all locale keys
|
||||
/// </summary>
|
||||
/// <returns> Generic collection of keys </returns>
|
||||
public ICollection<string> GetKeys()
|
||||
{
|
||||
return _i18nService.GetLocalisedKeys();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From the provided partial key, find all keys that start with text and choose a random match
|
||||
/// </summary>
|
||||
/// <param name="partialKey"> Key to match locale keys on </param>
|
||||
/// <returns> Locale text </returns>
|
||||
public string GetRandomTextThatMatchesPartialKey(string partialKey)
|
||||
{
|
||||
var matchingKeys = GetKeys().Where(x => x.Contains(partialKey)).ToList();
|
||||
if (!matchingKeys.Any())
|
||||
{
|
||||
_logger.Warning($"No locale keys found for: {partialKey}");
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return GetText(_randomUtil.GetArrayValue(matchingKeys));
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class LocationLifecycleService
|
||||
protected InRaidConfig _inRaidConfig;
|
||||
protected InRaidHelper _inRaidHelper;
|
||||
protected InsuranceService _insuranceService;
|
||||
protected LocalisationService _localisationService;
|
||||
protected ServerLocalisationService _serverLocalisationService;
|
||||
protected LocationConfig _locationConfig;
|
||||
protected LocationLootGenerator _locationLootGenerator;
|
||||
protected ISptLogger<LocationLifecycleService> _logger;
|
||||
@@ -71,7 +71,7 @@ public class LocationLifecycleService
|
||||
ICloner cloner,
|
||||
RaidTimeAdjustmentService raidTimeAdjustmentService,
|
||||
LocationLootGenerator locationLootGenerator,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
BotLootCacheService botLootCacheService,
|
||||
LootGenerator lootGenerator,
|
||||
MailSendService mailSendService,
|
||||
@@ -103,7 +103,7 @@ public class LocationLifecycleService
|
||||
_cloner = cloner;
|
||||
_raidTimeAdjustmentService = raidTimeAdjustmentService;
|
||||
_locationLootGenerator = locationLootGenerator;
|
||||
_localisationService = localisationService;
|
||||
_serverLocalisationService = localisationService;
|
||||
_botLootCacheService = botLootCacheService;
|
||||
_lootGenerator = lootGenerator;
|
||||
_mailSendService = mailSendService;
|
||||
@@ -799,7 +799,7 @@ public class LocationLifecycleService
|
||||
if (pmcQuest is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"inraid-unable_to_migrate_pmc_quest_not_found_in_profile",
|
||||
scavQuest.QId
|
||||
)
|
||||
|
||||
@@ -23,7 +23,7 @@ public class MailSendService(
|
||||
NotifierHelper _notifierHelper,
|
||||
DialogueHelper _dialogueHelper,
|
||||
NotificationSendHelper _notificationSendHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ItemHelper _itemHelper,
|
||||
TraderHelper _traderHelper,
|
||||
ICloner _cloner
|
||||
@@ -62,7 +62,7 @@ public class MailSendService(
|
||||
if (trader is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"mailsend-missing_trader",
|
||||
new { messageType, sessionId }
|
||||
)
|
||||
@@ -126,7 +126,7 @@ public class MailSendService(
|
||||
if (trader is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"mailsend-missing_trader",
|
||||
new { messageType, sessionId }
|
||||
)
|
||||
@@ -357,7 +357,9 @@ public class MailSendService(
|
||||
|| !playerProfile.DialogueRecords.TryGetValue(targetNpcId, out var dialogWithNpc)
|
||||
)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("mailsend-missing_npc_dialog", targetNpcId));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("mailsend-missing_npc_dialog", targetNpcId)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -493,7 +495,7 @@ public class MailSendService(
|
||||
var parentItem = GetBaseItemFromRewards(messageDetails.Items);
|
||||
if (parentItem is null)
|
||||
{
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"mailsend-missing_parent",
|
||||
new { traderId = messageDetails.Trader, sender = messageDetails.Sender }
|
||||
);
|
||||
@@ -524,7 +526,7 @@ public class MailSendService(
|
||||
if (itemTemplate is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"dialog-missing_item_template",
|
||||
new { tpl = reward.Template, type = dialogType }
|
||||
)
|
||||
@@ -570,7 +572,7 @@ public class MailSendService(
|
||||
if (itemTemplate.Properties.StackSlots is not null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"mail-unable_to_give_gift_not_handled",
|
||||
itemTemplate.Id
|
||||
)
|
||||
@@ -635,7 +637,7 @@ public class MailSendService(
|
||||
if (senderId is null)
|
||||
{
|
||||
throw new Exception(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"mail-unable_to_find_message_sender_by_id",
|
||||
messageDetails.Sender
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace SPTarkov.Server.Core.Services;
|
||||
public class OpenZoneService(
|
||||
ISptLogger<OpenZoneService> _logger,
|
||||
DatabaseService _databaseService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ConfigServer _configServer
|
||||
)
|
||||
{
|
||||
@@ -43,7 +43,7 @@ public class OpenZoneService(
|
||||
{
|
||||
if (!dbLocations.ContainsKey(mapKvP.Key))
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("openzone-unable_to_find_map", mapKvP));
|
||||
_logger.Error(_serverLocalisationService.GetText("openzone-unable_to_find_map", mapKvP));
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public class PaymentService(
|
||||
TraderHelper _traderHelper,
|
||||
ItemHelper _itemHelper,
|
||||
InventoryHelper _inventoryHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
PaymentHelper _paymentHelper,
|
||||
ConfigServer _configServer
|
||||
)
|
||||
@@ -135,7 +135,7 @@ public class PaymentService(
|
||||
// If no currency-based payment is involved, handle it separately
|
||||
if (totalCurrencyAmount == 0 && payToTrader)
|
||||
{
|
||||
_logger.Debug(_localisationService.GetText("payment-zero_price_no_payment"));
|
||||
_logger.Debug(_serverLocalisationService.GetText("payment-zero_price_no_payment"));
|
||||
|
||||
// Convert the handbook price to the trader's currency and update the sales sum.
|
||||
var costOfPurchaseInCurrency = _handbookHelper.FromRUB(
|
||||
@@ -336,14 +336,14 @@ public class PaymentService(
|
||||
if (moneyItemsInInventory.Count <= 0 || amountAvailable < amountToPay)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"payment-not_enough_money_to_complete_transation", // Typo, needs locale updated if fixed
|
||||
new { amountToPay, amountAvailable }
|
||||
)
|
||||
);
|
||||
_httpResponseUtil.AppendErrorToOutput(
|
||||
output,
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"payment-not_enough_money_to_complete_transation_short",
|
||||
amountToPay
|
||||
), // Typo, needs locale updated if fixed
|
||||
|
||||
@@ -20,7 +20,7 @@ public class PmcChatResponseService(
|
||||
NotificationSendHelper _notificationSendHelper,
|
||||
WeightedRandomHelper _weightedRandomHelper,
|
||||
DatabaseService _databaseService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
GiftService _giftService,
|
||||
LocaleService _localeService,
|
||||
MatchBotDetailsCacheService _matchBotDetailsCacheService,
|
||||
@@ -142,14 +142,14 @@ public class PmcChatResponseService(
|
||||
if (possibleResponseLocaleKeys.Count == 0)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("pmcresponse-unable_to_find_key", responseType)
|
||||
_serverLocalisationService.GetText("pmcresponse-unable_to_find_key", responseType)
|
||||
);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// Choose random response from above list and request it from localisation service
|
||||
var responseText = _localisationService.GetText(
|
||||
var responseText = _serverLocalisationService.GetText(
|
||||
_randomUtil.GetArrayValue(possibleResponseLocaleKeys),
|
||||
new
|
||||
{
|
||||
@@ -173,7 +173,7 @@ public class PmcChatResponseService(
|
||||
|
||||
if (AppendSuffixToMessageEnd(isVictim))
|
||||
{
|
||||
var suffixText = _localisationService.GetText(
|
||||
var suffixText = _serverLocalisationService.GetText(
|
||||
_randomUtil.GetArrayValue(GetResponseSuffixLocaleKeys())
|
||||
);
|
||||
responseText += $" {suffixText}";
|
||||
@@ -268,7 +268,7 @@ public class PmcChatResponseService(
|
||||
protected List<string> GetResponseLocaleKeys(string keyType, bool isVictim = true)
|
||||
{
|
||||
var keyBase = isVictim ? "pmcresponse-victim_" : "pmcresponse-killer_";
|
||||
var keys = _localisationService.GetKeys();
|
||||
var keys = _serverLocalisationService.GetLocaleKeys();
|
||||
|
||||
return keys.Where(x => x.StartsWith($"{keyBase}{keyType}")).ToList();
|
||||
}
|
||||
@@ -279,7 +279,7 @@ public class PmcChatResponseService(
|
||||
/// <returns> List of keys </returns>
|
||||
protected List<string> GetResponseSuffixLocaleKeys()
|
||||
{
|
||||
var keys = _localisationService.GetKeys();
|
||||
var keys = _serverLocalisationService.GetLocaleKeys();
|
||||
|
||||
return keys.Where(x => x.StartsWith("pmcresponse-suffix")).ToList();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class PostDbLoadService(
|
||||
ISptLogger<PostDbLoadService> _logger,
|
||||
HashUtil _hashUtil,
|
||||
DatabaseService _databaseService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
SeasonalEventService _seasonalEventService,
|
||||
CustomLocationWaveService _customLocationWaveService,
|
||||
OpenZoneService _openZoneService,
|
||||
@@ -270,7 +270,7 @@ public class PostDbLoadService(
|
||||
if (mapId is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-unable_to_add_custom_loot_position",
|
||||
mapId
|
||||
)
|
||||
@@ -286,7 +286,7 @@ public class PostDbLoadService(
|
||||
if (looselootData is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-map_has_no_loose_loot_data",
|
||||
mapId
|
||||
)
|
||||
@@ -382,7 +382,10 @@ public class PostDbLoadService(
|
||||
if (!mapsDb.TryGetValue(mapId, out var map))
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("bot-unable_to_edit_limits_of_unknown_map", mapId)
|
||||
_serverLocalisationService.GetText(
|
||||
"bot-unable_to_edit_limits_of_unknown_map",
|
||||
mapId
|
||||
)
|
||||
);
|
||||
|
||||
continue;
|
||||
@@ -431,7 +434,7 @@ public class PostDbLoadService(
|
||||
if (looselootData is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-map_has_no_loose_loot_data",
|
||||
mapId
|
||||
)
|
||||
@@ -448,7 +451,7 @@ public class PostDbLoadService(
|
||||
if (lootPostionToAdjust is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"location-unable_to_adjust_loot_position_on_map",
|
||||
new { lootKey, mapId }
|
||||
)
|
||||
@@ -620,7 +623,7 @@ public class PostDbLoadService(
|
||||
questName = quests[questKey]?.QuestName ?? "UNKNOWN",
|
||||
};
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"assort-missing_quest_assort_unlock",
|
||||
messageValues
|
||||
)
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ProfileFixerService(
|
||||
TraderHelper _traderHelper,
|
||||
HideoutHelper _hideoutHelper,
|
||||
DatabaseService _databaseService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ConfigServer _configServer,
|
||||
InventoryHelper _inventoryHelper
|
||||
)
|
||||
@@ -413,7 +413,7 @@ public class ProfileFixerService(
|
||||
if (matchingProductions.Count != 1)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"quest-unable_to_find_matching_hideout_production",
|
||||
new
|
||||
{
|
||||
@@ -658,7 +658,7 @@ public class ProfileFixerService(
|
||||
if (!itemsDb.ContainsKey(item.Template))
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("fixer-mod_item_found", item.Template)
|
||||
_serverLocalisationService.GetText("fixer-mod_item_found", item.Template)
|
||||
);
|
||||
|
||||
if (_coreConfig.Fixes.RemoveModItemsFromProfile)
|
||||
@@ -734,7 +734,10 @@ public class ProfileFixerService(
|
||||
if (!itemsDb.ContainsKey(item.Template))
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("fixer-mod_item_found", item.Template)
|
||||
_serverLocalisationService.GetText(
|
||||
"fixer-mod_item_found",
|
||||
item.Template
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -762,7 +765,7 @@ public class ProfileFixerService(
|
||||
{
|
||||
// Item in profile not found in db, not good
|
||||
_logger.Error(
|
||||
_localisationService.GetText("fixer-clothing_item_found", clothingItem)
|
||||
_serverLocalisationService.GetText("fixer-clothing_item_found", clothingItem)
|
||||
);
|
||||
|
||||
if (_coreConfig.Fixes.RemoveModItemsFromProfile)
|
||||
@@ -790,7 +793,10 @@ public class ProfileFixerService(
|
||||
if (!_traderHelper.TraderExists(activeQuest.TraderId))
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("fixer-trader_found", activeQuest.TraderId)
|
||||
_serverLocalisationService.GetText(
|
||||
"fixer-trader_found",
|
||||
activeQuest.TraderId
|
||||
)
|
||||
);
|
||||
if (_coreConfig.Fixes.RemoveModItemsFromProfile)
|
||||
{
|
||||
@@ -834,7 +840,7 @@ public class ProfileFixerService(
|
||||
)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("fixer-trader_found", TraderPurchaseKvP.Key)
|
||||
_serverLocalisationService.GetText("fixer-trader_found", TraderPurchaseKvP.Key)
|
||||
);
|
||||
if (_coreConfig.Fixes.RemoveModItemsFromProfile)
|
||||
{
|
||||
@@ -868,7 +874,9 @@ public class ProfileFixerService(
|
||||
)
|
||||
)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("fixer-mod_item_found", item.Template));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("fixer-mod_item_found", item.Template)
|
||||
);
|
||||
|
||||
if (_coreConfig.Fixes.RemoveModItemsFromProfile)
|
||||
{
|
||||
@@ -894,7 +902,9 @@ public class ProfileFixerService(
|
||||
)
|
||||
)
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("fixer-mod_item_found", item.Template));
|
||||
_logger.Error(
|
||||
_serverLocalisationService.GetText("fixer-mod_item_found", item.Template)
|
||||
);
|
||||
|
||||
if (_coreConfig.Fixes.RemoveModItemsFromProfile)
|
||||
{
|
||||
@@ -936,7 +946,7 @@ public class ProfileFixerService(
|
||||
if (!itemsDb.ContainsKey(item.TemplateId))
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("fixer-mod_item_found", item.TemplateId)
|
||||
_serverLocalisationService.GetText("fixer-mod_item_found", item.TemplateId)
|
||||
);
|
||||
|
||||
if (_coreConfig.Fixes.RemoveModItemsFromProfile)
|
||||
@@ -1054,7 +1064,7 @@ public class ProfileFixerService(
|
||||
var traderId = traderKvP.Key;
|
||||
if (!_traderHelper.TraderExists(traderId))
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("fixer-trader_found", traderId));
|
||||
_logger.Error(_serverLocalisationService.GetText("fixer-trader_found", traderId));
|
||||
if (_coreConfig.Fixes.RemoveInvalidTradersFromProfile)
|
||||
{
|
||||
_logger.Warning(
|
||||
@@ -1070,7 +1080,7 @@ public class ProfileFixerService(
|
||||
var traderId = traderKvP.Key;
|
||||
if (!_traderHelper.TraderExists(traderId))
|
||||
{
|
||||
_logger.Error(_localisationService.GetText("fixer-trader_found", traderId));
|
||||
_logger.Error(_serverLocalisationService.GetText("fixer-trader_found", traderId));
|
||||
if (_coreConfig.Fixes.RemoveInvalidTradersFromProfile)
|
||||
{
|
||||
_logger.Warning(
|
||||
|
||||
@@ -22,7 +22,7 @@ public class RagfairOfferService(
|
||||
RagfairServerHelper ragfairServerHelper,
|
||||
ItemHelper itemHelper,
|
||||
ProfileHelper profileHelper,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
ICloner cloner,
|
||||
RagfairOfferHolder ragfairOfferHolder,
|
||||
NotifierHelper notifierHelper,
|
||||
|
||||
@@ -24,7 +24,7 @@ public class RagfairPriceService(
|
||||
PresetHelper _presetHelper,
|
||||
ItemHelper _itemHelper,
|
||||
DatabaseService _databaseService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ConfigServer _configServer
|
||||
)
|
||||
{
|
||||
@@ -85,7 +85,7 @@ public class RagfairPriceService(
|
||||
{
|
||||
var itemFromDb = _itemHelper.GetItem(tplId);
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"ragfair-unable_to_find_item_price_for_item_in_flea_handbook",
|
||||
new { tpl = tplId, name = itemFromDb.Value.Name ?? "" }
|
||||
)
|
||||
|
||||
@@ -29,7 +29,7 @@ public class RepairService(
|
||||
PaymentService _paymentService,
|
||||
ProfileHelper _profileHelper,
|
||||
RepairHelper _repairHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ConfigServer _configServer,
|
||||
WeightedRandomHelper _weightedRandomHelper
|
||||
)
|
||||
@@ -57,7 +57,7 @@ public class RepairService(
|
||||
if (itemToRepair is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"repair-unable_to_find_item_in_inventory_cant_repair",
|
||||
repairItemDetails.Id
|
||||
)
|
||||
@@ -69,7 +69,10 @@ public class RepairService(
|
||||
if (traderRepairDetails is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("repair-unable_to_find_trader_details_by_id", traderId)
|
||||
_serverLocalisationService.GetText(
|
||||
"repair-unable_to_find_trader_details_by_id",
|
||||
traderId
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -95,7 +98,7 @@ public class RepairService(
|
||||
if (itemRepairCost is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"repair-unable_to_find_item_repair_cost",
|
||||
itemToRepair.Template
|
||||
)
|
||||
@@ -199,7 +202,7 @@ public class RepairService(
|
||||
{
|
||||
// No item found
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"repair-unable_to_find_item_in_db",
|
||||
repairDetails.RepairedItem.Template
|
||||
)
|
||||
@@ -213,7 +216,7 @@ public class RepairService(
|
||||
if (repairDetails.RepairPoints is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"repair-item_has_no_repair_points",
|
||||
repairDetails.RepairedItem.Template
|
||||
)
|
||||
@@ -261,7 +264,7 @@ public class RepairService(
|
||||
if (repairDetails.RepairPoints is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"repair-item_has_no_repair_points",
|
||||
repairDetails.RepairedItem.Template
|
||||
)
|
||||
@@ -339,7 +342,7 @@ public class RepairService(
|
||||
if (itemToRepair is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"repair-item_not_found_unable_to_repair",
|
||||
itemToRepairId
|
||||
)
|
||||
@@ -375,7 +378,7 @@ public class RepairService(
|
||||
if (repairKitInInventory is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"repair-repair_kit_not_found_in_inventory",
|
||||
repairKit.Id
|
||||
)
|
||||
@@ -676,7 +679,7 @@ public class RepairService(
|
||||
if (repairDetails.RepairPoints is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"repair-item_has_no_repair_points",
|
||||
repairDetails.RepairedItem.Template
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ public class SeasonalEventService(
|
||||
TimeUtil _timeUtil,
|
||||
DatabaseService _databaseService,
|
||||
GiftService _giftService,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ProfileHelper _profileHelper,
|
||||
ConfigServer _configServer,
|
||||
RandomUtil _randomUtil
|
||||
@@ -345,7 +345,9 @@ public class SeasonalEventService(
|
||||
}
|
||||
}
|
||||
|
||||
_logger.Warning(_localisationService.GetText("season-no_matching_season_found_for_date"));
|
||||
_logger.Warning(
|
||||
_serverLocalisationService.GetText("season-no_matching_season_found_for_date")
|
||||
);
|
||||
|
||||
return Season.SUMMER;
|
||||
}
|
||||
@@ -365,7 +367,7 @@ public class SeasonalEventService(
|
||||
if (botInventory.Equipment[equipmentSlotKey] is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"seasonal-missing_equipment_slot_on_bot",
|
||||
new { equipmentSlot = equipmentSlotKey, botRole }
|
||||
)
|
||||
@@ -394,7 +396,7 @@ public class SeasonalEventService(
|
||||
if (prop is null)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"seasonal-missing_loot_container_slot_on_bot",
|
||||
new { lootContainer = lootContainerKey, botRole }
|
||||
)
|
||||
@@ -413,7 +415,9 @@ public class SeasonalEventService(
|
||||
/// <param name="event">Name of the event to enable. e.g. Christmas</param>
|
||||
private void UpdateGlobalEvents(Config globalConfig, SeasonalEvent eventType)
|
||||
{
|
||||
_logger.Success(_localisationService.GetText("season-event_is_active", eventType.Type));
|
||||
_logger.Success(
|
||||
_serverLocalisationService.GetText("season-event_is_active", eventType.Type)
|
||||
);
|
||||
_christmasEventActive = false;
|
||||
_halloweenEventActive = false;
|
||||
|
||||
@@ -1003,7 +1007,9 @@ public class SeasonalEventService(
|
||||
var botGearChanges = GetEventBotGear(eventType);
|
||||
if (botGearChanges is null)
|
||||
{
|
||||
_logger.Warning(_localisationService.GetText("gameevent-no_gear_data", eventType));
|
||||
_logger.Warning(
|
||||
_serverLocalisationService.GetText("gameevent-no_gear_data", eventType)
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1014,7 +1020,9 @@ public class SeasonalEventService(
|
||||
var botToUpdate = _databaseService.GetBots().Types[botKvP.Key.ToLower()];
|
||||
if (botToUpdate is null)
|
||||
{
|
||||
_logger.Warning(_localisationService.GetText("gameevent-bot_not_found", botKvP));
|
||||
_logger.Warning(
|
||||
_serverLocalisationService.GetText("gameevent-bot_not_found", botKvP)
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1049,7 +1057,9 @@ public class SeasonalEventService(
|
||||
var botLootChanges = GetEventBotLoot(eventType);
|
||||
if (botLootChanges is null)
|
||||
{
|
||||
_logger.Warning(_localisationService.GetText("gameevent-no_gear_data", eventType));
|
||||
_logger.Warning(
|
||||
_serverLocalisationService.GetText("gameevent-no_gear_data", eventType)
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1060,7 +1070,9 @@ public class SeasonalEventService(
|
||||
var botToUpdate = _databaseService.GetBots().Types[botKvpP.Key.ToLower()];
|
||||
if (botToUpdate is null)
|
||||
{
|
||||
_logger.Warning(_localisationService.GetText("gameevent-bot_not_found", botKvpP));
|
||||
_logger.Warning(
|
||||
_serverLocalisationService.GetText("gameevent-bot_not_found", botKvpP)
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
using SPTarkov.Common.Extensions;
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Models.Utils;
|
||||
using SPTarkov.Server.Core.Utils;
|
||||
using SPTarkov.Server.Core.Utils.Json;
|
||||
|
||||
namespace SPTarkov.Server.Core.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Handles translating server text into different languages
|
||||
/// </summary>
|
||||
[Injectable(InjectionType.Singleton)]
|
||||
public class ServerLocalisationService(
|
||||
ISptLogger<ServerLocalisationService> _logger,
|
||||
RandomUtil _randomUtil,
|
||||
LocaleService _localeService,
|
||||
JsonUtil _jsonUtil,
|
||||
FileUtil _fileUtil
|
||||
)
|
||||
{
|
||||
private readonly Dictionary<string, LazyLoad<Dictionary<string, string>>> _loadedLocales = [];
|
||||
private string _serverLocale = _localeService.GetDesiredServerLocale();
|
||||
private readonly Dictionary<string, string> _localeFallbacks =
|
||||
_localeService.GetLocaleFallbacks();
|
||||
private readonly string _defaultLocale = "en";
|
||||
private readonly string _localeDirectory = "./SPT_Data/database/locales/server";
|
||||
private bool _serverLocalesHydrated = false;
|
||||
|
||||
protected void HydrateServerLocales()
|
||||
{
|
||||
if (_serverLocalesHydrated)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var files = _fileUtil
|
||||
.GetFiles(_localeDirectory, true)
|
||||
.Where(f => _fileUtil.GetFileExtension(f) == "json")
|
||||
.ToList();
|
||||
|
||||
if (files.Count == 0)
|
||||
{
|
||||
throw new Exception($"Localisation files in directory {_localeDirectory} not found.");
|
||||
}
|
||||
|
||||
foreach (var file in files)
|
||||
{
|
||||
_loadedLocales.Add(
|
||||
_fileUtil.StripExtension(file),
|
||||
new LazyLoad<Dictionary<string, string>>(() =>
|
||||
_jsonUtil.DeserializeFromFile<Dictionary<string, string>>(file) ?? []
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (!_loadedLocales.ContainsKey(_defaultLocale))
|
||||
{
|
||||
throw new Exception(
|
||||
$"The default locale '{_defaultLocale}' does not exist on the loaded locales."
|
||||
);
|
||||
}
|
||||
|
||||
_serverLocalesHydrated = true;
|
||||
}
|
||||
|
||||
public void SetServerLocaleByKey(string locale)
|
||||
{
|
||||
if (_loadedLocales.ContainsKey(locale))
|
||||
{
|
||||
_serverLocale = locale;
|
||||
}
|
||||
else
|
||||
{
|
||||
var fallback = _localeFallbacks.Where(kv => locale.StartsWith(kv.Key.Replace("*", "")));
|
||||
if (fallback.Any())
|
||||
{
|
||||
var foundFallbackLocale = fallback.First().Value;
|
||||
if (!_loadedLocales.ContainsKey(foundFallbackLocale))
|
||||
{
|
||||
throw new Exception(
|
||||
$"Locale '{locale}' was not defined, and the found fallback locale did not match any of the loaded locales."
|
||||
);
|
||||
}
|
||||
|
||||
_serverLocale = foundFallbackLocale;
|
||||
}
|
||||
|
||||
_serverLocale = _defaultLocale;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a localised value using the passed in key
|
||||
/// </summary>
|
||||
/// <param name="key"> Key to look up locale for </param>
|
||||
/// <param name="args"> optional arguments </param>
|
||||
/// <returns> Localised string </returns>
|
||||
public string GetText(string key, object? args = null)
|
||||
{
|
||||
return args is null ? GetLocalisedValue(key) : GetLocalised(key, args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a localised value using the passed in key
|
||||
/// </summary>
|
||||
/// <param name="key"> Key to look up locale for </param>
|
||||
/// <param name="value"> Value to localize </param>
|
||||
/// <returns> Localised string </returns>
|
||||
public string GetText<T>(string key, T value)
|
||||
where T : IConvertible?
|
||||
{
|
||||
return GetLocalised(key, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get all locale keys
|
||||
/// </summary>
|
||||
/// <returns> Generic collection of keys </returns>
|
||||
public IEnumerable<string> GetLocaleKeys()
|
||||
{
|
||||
return _loadedLocales["en"].Value?.Keys ?? Enumerable.Empty<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// From the provided partial key, find all keys that start with text and choose a random match
|
||||
/// </summary>
|
||||
/// <param name="partialKey"> Key to match locale keys on </param>
|
||||
/// <returns> Locale text </returns>
|
||||
public string GetRandomTextThatMatchesPartialKey(string partialKey)
|
||||
{
|
||||
var matchingKeys = GetLocaleKeys().Where(x => x.Contains(partialKey)).ToList();
|
||||
|
||||
if (matchingKeys.Count == 0)
|
||||
{
|
||||
_logger.Warning($"No locale keys found for: {partialKey}");
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return GetText(_randomUtil.GetArrayValue(matchingKeys));
|
||||
}
|
||||
|
||||
public string GetLocalisedValue(string key)
|
||||
{
|
||||
// On the initial localised request, hydrate server locales
|
||||
if (!_serverLocalesHydrated)
|
||||
{
|
||||
HydrateServerLocales();
|
||||
}
|
||||
|
||||
// get loaded locales for set key
|
||||
if (!_loadedLocales.TryGetValue(_serverLocale, out var locales))
|
||||
{
|
||||
// if we are unable to get the "loadedLocales" for the set locale, return the key
|
||||
return key;
|
||||
}
|
||||
|
||||
// searching through loaded locales for given key
|
||||
if (!locales.Value.TryGetValue(key, out var value))
|
||||
{
|
||||
// if the key is not found in loaded locales
|
||||
// check if the key is found in the default locale
|
||||
_loadedLocales.TryGetValue(_defaultLocale, out var defaults);
|
||||
if (!defaults.Value.TryGetValue(key, out value))
|
||||
{
|
||||
value = _localeService
|
||||
.GetLocaleDb(_defaultLocale)
|
||||
.FirstOrDefault(x => x.Key == key)
|
||||
.Value;
|
||||
}
|
||||
|
||||
return value ?? key;
|
||||
}
|
||||
|
||||
// if the key is found in the server locale, return the value
|
||||
return value;
|
||||
}
|
||||
|
||||
protected string GetLocalised(string key, object? args)
|
||||
{
|
||||
var rawLocalizedString = GetLocalisedValue(key);
|
||||
if (args == null)
|
||||
{
|
||||
return rawLocalizedString;
|
||||
}
|
||||
|
||||
var typeProps = args.GetType().GetProperties();
|
||||
|
||||
foreach (var propertyInfo in typeProps)
|
||||
{
|
||||
var localizedName = $"{{{{{propertyInfo.GetJsonName()}}}}}";
|
||||
if (rawLocalizedString.Contains(localizedName))
|
||||
{
|
||||
rawLocalizedString = rawLocalizedString.Replace(
|
||||
localizedName,
|
||||
propertyInfo.GetValue(args)?.ToString() ?? string.Empty
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return rawLocalizedString;
|
||||
}
|
||||
|
||||
protected string GetLocalised<T>(string key, T? value)
|
||||
where T : IConvertible?
|
||||
{
|
||||
var rawLocalizedString = GetLocalisedValue(key);
|
||||
return rawLocalizedString.Replace("%s", value?.ToString() ?? string.Empty);
|
||||
}
|
||||
|
||||
// gets the localized string directly
|
||||
protected string GetLocalised<T>(string key)
|
||||
{
|
||||
return GetLocalisedValue(key);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public class TraderPurchasePersisterService(
|
||||
RandomUtil _randomUtil,
|
||||
TimeUtil _timeUtil,
|
||||
ProfileHelper _profileHelper,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ConfigServer _configServer
|
||||
)
|
||||
{
|
||||
@@ -125,7 +125,7 @@ public class TraderPurchasePersisterService(
|
||||
if (traderUpdateDetails is null)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"trader-unable_to_delete_stale_purchases",
|
||||
new { profileId = profile.ProfileInfo.ProfileId, traderId }
|
||||
)
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace SPTarkov.Server.Core.Services;
|
||||
public class TraderStore(
|
||||
DatabaseService databaseService,
|
||||
IEnumerable<ITrader> injectedTraders,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
ISptLogger<TraderStore> logger
|
||||
) : IOnLoad
|
||||
{
|
||||
|
||||
@@ -13,9 +13,10 @@ namespace SPTarkov.Server.Core.Utils;
|
||||
public class App(
|
||||
IServiceProvider _serviceProvider,
|
||||
ISptLogger<App> _logger,
|
||||
DatabaseImporter _databaseImporter,
|
||||
TimeUtil _timeUtil,
|
||||
RandomUtil _randomUtil,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ConfigServer _configServer,
|
||||
EncodingUtil _encodingUtil,
|
||||
HttpServer _httpServer,
|
||||
@@ -33,13 +34,10 @@ public class App(
|
||||
{
|
||||
ServiceLocator.SetServiceProvider(_serviceProvider);
|
||||
|
||||
// execute onLoad callbacks
|
||||
_logger.Info(_localisationService.GetText("executing_startup_callbacks"));
|
||||
|
||||
var isAlreadyRunning = _httpServerHelper.IsAlreadyRunning();
|
||||
if (isAlreadyRunning)
|
||||
{
|
||||
_logger.Critical(_localisationService.GetText("webserver_already_running"));
|
||||
_logger.Critical(_serverLocalisationService.GetText("webserver_already_running"));
|
||||
await Task.Delay(Timeout.Infinite);
|
||||
}
|
||||
|
||||
@@ -68,6 +66,8 @@ public class App(
|
||||
}
|
||||
}
|
||||
|
||||
// execute onLoad callbacks
|
||||
_logger.Info(_serverLocalisationService.GetText("executing_startup_callbacks"));
|
||||
foreach (var onLoad in _onLoadComponents)
|
||||
{
|
||||
await onLoad.OnLoad();
|
||||
@@ -82,13 +82,13 @@ public class App(
|
||||
if (!_httpServer.IsStarted())
|
||||
{
|
||||
_logger.Success(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"started_webserver_success",
|
||||
_httpServer.ListeningUrl()
|
||||
)
|
||||
);
|
||||
_logger.Success(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"websocket-started",
|
||||
_httpServer.ListeningUrl().Replace("https://", "wss://")
|
||||
)
|
||||
@@ -104,10 +104,12 @@ public class App(
|
||||
{
|
||||
if (_randomUtil.GetInt(1, 1000) > 999)
|
||||
{
|
||||
return _localisationService.GetRandomTextThatMatchesPartialKey("server_start_meme_");
|
||||
return _serverLocalisationService.GetRandomTextThatMatchesPartialKey(
|
||||
"server_start_meme_"
|
||||
);
|
||||
}
|
||||
|
||||
return _localisationService.GetText("server_start_success");
|
||||
return _serverLocalisationService.GetText("server_start_success");
|
||||
}
|
||||
|
||||
protected async Task Update()
|
||||
@@ -155,7 +157,7 @@ public class App(
|
||||
protected void LogUpdateException(Exception err, IOnUpdate updateable)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText(
|
||||
_serverLocalisationService.GetText(
|
||||
"scheduled_event_failed_to_run",
|
||||
updateable.GetType().FullName
|
||||
)
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace SPTarkov.Server.Core.Utils;
|
||||
public class DatabaseImporter(
|
||||
ISptLogger<DatabaseImporter> logger,
|
||||
FileUtil _fileUtil,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
DatabaseServer _databaseServer,
|
||||
ImageRouter _imageRouter,
|
||||
ImporterUtil _importerUtil,
|
||||
@@ -101,14 +101,14 @@ public class DatabaseImporter(
|
||||
else
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("validation_error_exception", checksFilePath)
|
||||
_serverLocalisationService.GetText("validation_error_exception", checksFilePath)
|
||||
);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
_logger.Error(
|
||||
_localisationService.GetText("validation_error_exception", checksFilePath)
|
||||
_serverLocalisationService.GetText("validation_error_exception", checksFilePath)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,7 @@ public class DatabaseImporter(
|
||||
*/
|
||||
protected async Task HydrateDatabase(string filePath)
|
||||
{
|
||||
_logger.Info(_localisationService.GetText("importing_database"));
|
||||
_logger.Info(_serverLocalisationService.GetText("importing_database"));
|
||||
Stopwatch timer = new();
|
||||
timer.Start();
|
||||
|
||||
@@ -144,7 +144,7 @@ public class DatabaseImporter(
|
||||
|
||||
dataToImport.Traders = tempTraders;
|
||||
|
||||
_logger.Info(_localisationService.GetText("importing_database_finish"));
|
||||
_logger.Info(_serverLocalisationService.GetText("importing_database_finish"));
|
||||
_logger.Debug($"Database import took {timer.ElapsedMilliseconds}ms");
|
||||
_databaseServer.SetTables(dataToImport);
|
||||
}
|
||||
@@ -175,14 +175,14 @@ public class DatabaseImporter(
|
||||
if (databaseHashes[relativePath] != hashString)
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("validation_error_file", fileName)
|
||||
_serverLocalisationService.GetText("validation_error_file", fileName)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("validation_error_file", fileName)
|
||||
_serverLocalisationService.GetText("validation_error_file", fileName)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace SPTarkov.Server.Core.Utils;
|
||||
public class HttpResponseUtil
|
||||
{
|
||||
protected readonly JsonUtil _jsonUtil;
|
||||
protected readonly LocalisationService _localisationService;
|
||||
protected readonly ServerLocalisationService _serverLocalisationService;
|
||||
|
||||
protected readonly ImmutableList<Regex> _cleanupRegexList =
|
||||
[
|
||||
@@ -23,9 +23,9 @@ public class HttpResponseUtil
|
||||
new("[\\t]"),
|
||||
];
|
||||
|
||||
public HttpResponseUtil(JsonUtil jsonUtil, LocalisationService localisationService)
|
||||
public HttpResponseUtil(JsonUtil jsonUtil, ServerLocalisationService localisationService)
|
||||
{
|
||||
_localisationService = localisationService;
|
||||
_serverLocalisationService = localisationService;
|
||||
_jsonUtil = jsonUtil;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class HttpResponseUtil
|
||||
{
|
||||
if (string.IsNullOrEmpty(message))
|
||||
{
|
||||
message = _localisationService.GetText("http-unknown_error");
|
||||
message = _serverLocalisationService.GetText("http-unknown_error");
|
||||
}
|
||||
|
||||
if (output.Warnings?.Count > 0)
|
||||
|
||||
@@ -15,7 +15,7 @@ public class RagfairOfferHolder(
|
||||
RagfairServerHelper _ragfairServerHelper,
|
||||
ProfileHelper _profileHelper,
|
||||
HashUtil _hashUtil,
|
||||
LocalisationService _localisationService,
|
||||
ServerLocalisationService _serverLocalisationService,
|
||||
ItemHelper _itemHelper
|
||||
)
|
||||
{
|
||||
@@ -182,7 +182,10 @@ public class RagfairOfferHolder(
|
||||
if (!_offersById.TryGetValue(offerId, out var offer))
|
||||
{
|
||||
_logger.Warning(
|
||||
_localisationService.GetText("ragfair-unable_to_remove_offer_doesnt_exist", offerId)
|
||||
_serverLocalisationService.GetText(
|
||||
"ragfair-unable_to_remove_offer_doesnt_exist",
|
||||
offerId
|
||||
)
|
||||
);
|
||||
|
||||
return;
|
||||
|
||||
@@ -15,7 +15,7 @@ public class WatermarkLocale
|
||||
protected readonly List<string> Modding;
|
||||
protected readonly List<string> Warning;
|
||||
|
||||
public WatermarkLocale(LocalisationService localisationService)
|
||||
public WatermarkLocale(ServerLocalisationService localisationService)
|
||||
{
|
||||
Description =
|
||||
[
|
||||
@@ -66,7 +66,7 @@ public class WatermarkLocale
|
||||
public class Watermark : IOnLoad
|
||||
{
|
||||
protected ConfigServer _configServer;
|
||||
protected LocalisationService _localisationService;
|
||||
protected ServerLocalisationService _serverLocalisationService;
|
||||
|
||||
protected ISptLogger<Watermark> _logger;
|
||||
protected WatermarkLocale _watermarkLocale;
|
||||
@@ -77,13 +77,13 @@ public class Watermark : IOnLoad
|
||||
public Watermark(
|
||||
ISptLogger<Watermark> logger,
|
||||
ConfigServer configServer,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
WatermarkLocale watermarkLocale
|
||||
)
|
||||
{
|
||||
_logger = logger;
|
||||
_configServer = configServer;
|
||||
_localisationService = localisationService;
|
||||
_serverLocalisationService = localisationService;
|
||||
_watermarkLocale = watermarkLocale;
|
||||
sptConfig = _configServer.GetConfig<CoreConfig>();
|
||||
}
|
||||
@@ -114,7 +114,7 @@ public class Watermark : IOnLoad
|
||||
{
|
||||
foreach (var key in sptConfig.CustomWatermarkLocaleKeys)
|
||||
{
|
||||
text.AddRange(["", _localisationService.GetText(key)]);
|
||||
text.AddRange(["", _serverLocalisationService.GetText(key)]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public class Watermark : IOnLoad
|
||||
{
|
||||
var sptVersion = ProgramStatics.SPT_VERSION() ?? sptConfig.SptVersion;
|
||||
var versionTag = /*ProgramStatics.DEBUG*/
|
||||
$"{sptVersion} - {_localisationService.GetText("bleeding_edge_build")}";
|
||||
$"{sptVersion} - {_serverLocalisationService.GetText("bleeding_edge_build")}";
|
||||
|
||||
if (withEftVersion)
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace SPTarkov.Server.Modding;
|
||||
|
||||
public class ModValidator(
|
||||
ISptLogger<ModValidator> logger,
|
||||
LocalisationService localisationService,
|
||||
ServerLocalisationService localisationService,
|
||||
ConfigServer configServer,
|
||||
ISemVer semVer,
|
||||
ModLoadOrder modLoadOrder,
|
||||
|
||||
Reference in New Issue
Block a user