diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs index 9bd1e433..bc6f8994 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs @@ -687,14 +687,12 @@ public class BotLootGenerator( Dictionary modChances ) { - var chosenWeaponType = randomUtil.GetArrayValue( - [ - nameof(EquipmentSlots.FirstPrimaryWeapon), - nameof(EquipmentSlots.FirstPrimaryWeapon), - nameof(EquipmentSlots.FirstPrimaryWeapon), - nameof(EquipmentSlots.Holster), - ] - ); + var chosenWeaponType = randomUtil.GetArrayValue([ + nameof(EquipmentSlots.FirstPrimaryWeapon), + nameof(EquipmentSlots.FirstPrimaryWeapon), + nameof(EquipmentSlots.FirstPrimaryWeapon), + nameof(EquipmentSlots.Holster), + ]); var randomisedWeaponCount = randomUtil.GetInt( PMCConfig.LooseWeaponInBackpackLootMinMax.Min, PMCConfig.LooseWeaponInBackpackLootMinMax.Max diff --git a/Libraries/SPTarkov.Server.Core/Generators/LootGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/LootGenerator.cs index e09ad6d9..856eb697 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/LootGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/LootGenerator.cs @@ -53,16 +53,14 @@ public class LootGenerator( { // Choose one at random + add to results array var chosenSealedContainer = randomUtil.GetArrayValue(sealedWeaponContainerPool); - result.Add( - [ - new Item - { - Id = new MongoId(), - Template = chosenSealedContainer.Id, - Upd = new Upd { StackObjectsCount = 1, SpawnedInSession = true }, - }, - ] - ); + result.Add([ + new Item + { + Id = new MongoId(), + Template = chosenSealedContainer.Id, + Upd = new Upd { StackObjectsCount = 1, SpawnedInSession = true }, + }, + ]); } } diff --git a/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestGeneration/CompletionQuestGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestGeneration/CompletionQuestGenerator.cs index 32d98145..0a25b95c 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestGeneration/CompletionQuestGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestGeneration/CompletionQuestGenerator.cs @@ -349,9 +349,10 @@ public class CompletionQuestGenerator( { var onlyFoundInRaid = completionConfig.RequiredItemsAreFiR; var minDurability = itemHelper.IsOfBaseclasses(itemTpl, [BaseClasses.WEAPON, BaseClasses.ARMOR]) - ? randomUtil.GetArrayValue( - [completionConfig.RequiredItemMinDurabilityMinMax.Min, completionConfig.RequiredItemMinDurabilityMinMax.Max] - ) + ? randomUtil.GetArrayValue([ + completionConfig.RequiredItemMinDurabilityMinMax.Min, + completionConfig.RequiredItemMinDurabilityMinMax.Max, + ]) : 0; // Dog tags MUST NOT be FiR for them to work diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceChristmasMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceChristmasMessageHandler.cs index 58e79a48..3c3a7da4 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceChristmasMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceChristmasMessageHandler.cs @@ -34,9 +34,9 @@ public class ForceChristmasMessageHandler( _mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - _randomUtil.GetArrayValue( - [_serverLocalisationService.GetText("chatbot-forced_event_enabled", SeasonalEventType.Christmas)] - ), + _randomUtil.GetArrayValue([ + _serverLocalisationService.GetText("chatbot-forced_event_enabled", SeasonalEventType.Christmas), + ]), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceHalloweenMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceHalloweenMessageHandler.cs index 39671c11..14def840 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceHalloweenMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceHalloweenMessageHandler.cs @@ -34,9 +34,9 @@ public class ForceHalloweenMessageHandler( _mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - _randomUtil.GetArrayValue( - [_serverLocalisationService.GetText("chatbot-forced_event_enabled", SeasonalEventType.Halloween)] - ), + _randomUtil.GetArrayValue([ + _serverLocalisationService.GetText("chatbot-forced_event_enabled", SeasonalEventType.Halloween), + ]), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/HelloMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/HelloMessageHandler.cs index 043275e8..007a47cd 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/HelloMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/HelloMessageHandler.cs @@ -29,21 +29,19 @@ public class HelloMessageHandler(MailSendService mailSendService, RandomUtil ran mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - randomUtil.GetArrayValue( - [ - "Howdy", - "Hi", - "Greetings", - "Hello", - "Bonjor", - "Yo", - "Sup", - "Heyyyyy", - "Hey there", - "OH its you", - $"Hello {sender?.Info?.Nickname}", - ] - ), + randomUtil.GetArrayValue([ + "Howdy", + "Hi", + "Greetings", + "Hello", + "Bonjor", + "Yo", + "Sup", + "Heyyyyy", + "Hey there", + "OH its you", + $"Hello {sender?.Info?.Nickname}", + ]), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/LoveYouChatMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/LoveYouChatMessageHandler.cs index c0e25745..7d29181a 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/LoveYouChatMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/LoveYouChatMessageHandler.cs @@ -25,14 +25,12 @@ public class LoveYouChatMessageHandler(MailSendService _mailSendService, RandomU _mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - _randomUtil.GetArrayValue( - [ - "That's quite forward but i love you too in a purely chatbot-human way", - "I love you too buddy :3!", - "uwu", - $"love you too {sender?.Info?.Nickname}", - ] - ), + _randomUtil.GetArrayValue([ + "That's quite forward but i love you too in a purely chatbot-human way", + "I love you too buddy :3!", + "uwu", + $"love you too {sender?.Info?.Nickname}", + ]), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/NikitaMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/NikitaMessageHandler.cs index 9d63a85c..59bc1955 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/NikitaMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/NikitaMessageHandler.cs @@ -25,15 +25,13 @@ public class NikitaMessageHandler(MailSendService _mailSendService, RandomUtil _ _mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - _randomUtil.GetArrayValue( - [ - "I know that guy!", - "Cool guy, he made EFT!", - "Legend", - "The mastermind of my suffering", - "Remember when he said webel-webel-webel-webel, classic Nikita moment", - ] - ), + _randomUtil.GetArrayValue([ + "I know that guy!", + "Cool guy, he made EFT!", + "Legend", + "The mastermind of my suffering", + "Remember when he said webel-webel-webel-webel, classic Nikita moment", + ]), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SendGiftMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SendGiftMessageHandler.cs index ae42e32c..cb93bfaf 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SendGiftMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SendGiftMessageHandler.cs @@ -47,15 +47,13 @@ public class SendGiftMessageHandler( mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - randomUtil.GetArrayValue( - [ - "Hey! you got the right code!", - "A secret code, how exciting!", - "You found a gift code!", - "A gift code! incredible", - "A gift! what could it be!", - ] - ), + randomUtil.GetArrayValue([ + "Hey! you got the right code!", + "A secret code, how exciting!", + "You found a gift code!", + "A gift code! incredible", + "A gift! what could it be!", + ]), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs index 0f25caaa..ce408040 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs @@ -1371,16 +1371,14 @@ public class HideoutHelper( List> itemsToAdd = []; for (var index = 0; index < craftedCoinCount; index++) { - itemsToAdd.Add( - [ - new Item - { - Id = new MongoId(), - Template = ItemTpl.BARTER_PHYSICAL_BITCOIN, - Upd = new Upd { StackObjectsCount = 1 }, - }, - ] - ); + itemsToAdd.Add([ + new Item + { + Id = new MongoId(), + Template = ItemTpl.BARTER_PHYSICAL_BITCOIN, + Upd = new Upd { StackObjectsCount = 1 }, + }, + ]); } // Create request for what we want to add to stash diff --git a/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs index 550be953..ae025796 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs @@ -65,9 +65,9 @@ public class PrestigeHelper( } else { - newProfile.CharacterData!.PmcData!.Skills!.Mastering = newProfile.CharacterData.PmcData.Skills.Mastering?.Union( - [skillToCopy] - ); + newProfile.CharacterData!.PmcData!.Skills!.Mastering = newProfile.CharacterData.PmcData.Skills.Mastering?.Union([ + skillToCopy, + ]); } } } diff --git a/Testing/UnitTests/DI.cs b/Testing/UnitTests/DI.cs index 825017ac..ce436c74 100644 --- a/Testing/UnitTests/DI.cs +++ b/Testing/UnitTests/DI.cs @@ -38,11 +38,9 @@ public class DI var diHandler = new DependencyInjectionHandler(services); diHandler.AddInjectableTypesFromTypeAssembly(typeof(App)); - diHandler.AddInjectableTypesFromTypeList( - [ - typeof(MockLogger<>), // TODO: this needs to be enabled but the randomizer needs to NOT be random, typeof(MockRandomUtil) - ] - ); + diHandler.AddInjectableTypesFromTypeList([ + typeof(MockLogger<>), // TODO: this needs to be enabled but the randomizer needs to NOT be random, typeof(MockRandomUtil) + ]); diHandler.InjectAll();