diff --git a/.editorconfig b/.editorconfig
index d18386f2..2de5aef7 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,11 +1,150 @@
+# editorconfig.org
+
+# top-most EditorConfig file
root = true
+# Default settings:
+# A newline ending every file
+# Use 4 spaces as indentation
[*]
-end_of_line = lf
insert_final_newline = true
-charset = utf-8
indent_style = space
indent_size = 4
-
-[*.md]
trim_trailing_whitespace = true
+
+[*.json]
+ij_formatter_enabled = false
+
+# C# files
+[*.cs]
+# New line preferences
+csharp_new_line_before_open_brace = all
+csharp_new_line_before_else = true
+csharp_new_line_before_catch = true
+csharp_new_line_before_finally = true
+csharp_new_line_before_members_in_object_initializers = true
+csharp_new_line_before_members_in_anonymous_types = true
+csharp_new_line_between_query_expression_clauses = true
+
+# ReSharper properties
+resharper_wrap_object_and_collection_initializer_style = chop_always
+
+# Indentation preferences
+csharp_indent_block_contents = true
+csharp_indent_braces = false
+csharp_indent_case_contents = true
+csharp_indent_case_contents_when_block = true
+csharp_indent_switch_labels = true
+csharp_indent_labels = one_less_than_current
+
+# Modifier preferences
+csharp_preferred_modifier_order = public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async:suggestion
+
+# avoid this. unless absolutely necessary
+dotnet_style_qualification_for_field = false
+dotnet_style_qualification_for_property = false
+dotnet_style_qualification_for_method = false
+dotnet_style_qualification_for_event = false
+
+# Types: use keywords instead of BCL types, and permit var only when the type is clear
+csharp_style_var_for_built_in_types = true:suggestion
+csharp_style_var_when_type_is_apparent = true:suggestion
+csharp_style_var_elsewhere = true:suggestion
+dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
+dotnet_style_predefined_type_for_member_access = true:suggestion
+
+# name all constant fields using PascalCase
+dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
+dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
+dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
+dotnet_naming_symbols.constant_fields.applicable_kinds = field
+dotnet_naming_symbols.constant_fields.required_modifiers = const
+dotnet_naming_style.pascal_case_style.capitalization = pascal_case
+
+# internal and private fields should be _camelCase
+dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
+dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
+dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
+dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
+dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
+dotnet_naming_style.camel_case_underscore_style.required_prefix = _
+dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
+
+# Code style defaults
+csharp_using_directive_placement = outside_namespace:error
+dotnet_sort_system_directives_first = true
+csharp_prefer_braces = true:warning
+csharp_preserve_single_line_blocks = false
+csharp_preserve_single_line_statements = false
+csharp_prefer_static_local_function = true:suggestion
+csharp_prefer_simple_using_statement = false:none
+csharp_style_prefer_switch_expression = true:suggestion
+dotnet_style_readonly_field = true:suggestion
+
+# Expression-level preferences
+dotnet_style_object_initializer = true:suggestion
+dotnet_style_collection_initializer = true:suggestion
+dotnet_style_explicit_tuple_names = true:suggestion
+dotnet_style_coalesce_expression = true:suggestion
+dotnet_style_null_propagation = true:suggestion
+dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
+dotnet_style_prefer_inferred_tuple_names = false:suggestion
+dotnet_style_prefer_inferred_anonymous_type_member_names = false:suggestion
+dotnet_style_prefer_auto_properties = false:suggestion
+dotnet_style_prefer_conditional_expression_over_assignment = true:silent
+dotnet_style_prefer_conditional_expression_over_return = true:silent
+csharp_prefer_simple_default_expression = true:suggestion
+
+# Expression-bodied members
+csharp_style_expression_bodied_methods = false:warning
+csharp_style_expression_bodied_constructors = false:warning
+csharp_style_expression_bodied_operators = false:warning
+csharp_style_expression_bodied_properties = false:warning
+csharp_style_expression_bodied_indexers = false:warning
+csharp_style_expression_bodied_accessors = false:warning
+csharp_style_expression_bodied_lambdas = false:warning
+csharp_style_expression_bodied_local_functions = false:warning
+
+# Pattern matching
+csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
+csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
+csharp_style_inlined_variable_declaration = true:suggestion
+
+# Null checking preferences
+csharp_style_throw_expression = true:suggestion
+csharp_style_conditional_delegate_call = true:suggestion
+
+# Other features
+csharp_style_prefer_index_operator = false:none
+csharp_style_prefer_range_operator = false:none
+csharp_style_pattern_local_over_anonymous_function = false:none
+
+# Space preferences
+csharp_space_after_cast = true
+csharp_space_after_colon_in_inheritance_clause = true
+csharp_space_after_comma = true
+csharp_space_after_dot = false
+csharp_space_after_keywords_in_control_flow_statements = true
+csharp_space_after_semicolon_in_for_statement = true
+csharp_space_around_binary_operators = before_and_after
+csharp_space_around_declaration_statements = false
+csharp_space_before_colon_in_inheritance_clause = true
+csharp_space_before_comma = false
+csharp_space_before_dot = false
+csharp_space_before_open_square_brackets = false
+csharp_space_before_semicolon_in_for_statement = false
+csharp_space_between_empty_square_brackets = false
+csharp_space_between_method_call_empty_parameter_list_parentheses = false
+csharp_space_between_method_call_name_and_opening_parenthesis = false
+csharp_space_between_method_call_parameter_list_parentheses = false
+csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
+csharp_space_between_method_declaration_name_and_open_parenthesis = false
+csharp_space_between_method_declaration_parameter_list_parentheses = false
+csharp_space_between_square_brackets = false
+
+# Xml project files
+[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
+indent_size = 2
+
+[*.{csproj,vbproj,proj,nativeproj,locproj}]
+charset = utf-8
\ No newline at end of file
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index c3b455bc..d8e5de95 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -2,8 +2,9 @@ name: Build
on:
push:
- branches:
- - main
+ branches: ["main"]
+ pull_request:
+ branches: ["*"]
jobs:
build:
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 2a281895..971deb62 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -1,8 +1,8 @@
name: Tests
on:
- #push:
- # branches: ["main"]
+ push:
+ branches: ["main"]
pull_request:
branches: ["*"]
diff --git a/.gitignore b/.gitignore
index 20dc5439..a0697c58 100644
--- a/.gitignore
+++ b/.gitignore
@@ -423,3 +423,5 @@ fabric.properties
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
+
+launchSettings.json
diff --git a/Benchmarks/Benchmarks.csproj b/Benchmarks/Benchmarks.csproj
new file mode 100644
index 00000000..ce51df85
--- /dev/null
+++ b/Benchmarks/Benchmarks.csproj
@@ -0,0 +1,24 @@
+
+
+
+
+
+ Exe
+ enable
+
+
+
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+
+
diff --git a/Benchmarks/ClonerBenchmarks.cs b/Benchmarks/ClonerBenchmarks.cs
new file mode 100644
index 00000000..8997b529
--- /dev/null
+++ b/Benchmarks/ClonerBenchmarks.cs
@@ -0,0 +1,50 @@
+using BenchmarkDotNet.Attributes;
+using Benchmarks.Mock;
+using SPTarkov.Server.Core.Models.Spt.Templates;
+using SPTarkov.Server.Core.Utils;
+using SPTarkov.Server.Core.Utils.Cloners;
+
+namespace Benchmarks;
+
+[SimpleJob(warmupCount: 10, iterationCount: 10)]
+[MemoryDiagnoser]
+public class ClonerBenchmarks
+{
+ private Templates? _templates;
+
+ private ICloner _jsonCloner;
+ private ICloner _reflectionsCloner;
+ private ICloner _fastCloner;
+
+ [GlobalSetup]
+ public void Setup()
+ {
+ var jsonUtil = new JsonUtil();
+ var importer = new ImporterUtil(new MockLogger(), new FileUtil(new MockLogger()),
+ jsonUtil);
+ var loadTask = importer.LoadRecursiveAsync("./Assets/database/templates/");
+ loadTask.Wait();
+ _templates = loadTask.Result;
+ _jsonCloner = new JsonCloner(jsonUtil);
+ _reflectionsCloner = new ReflectionsCloner(new MockLogger());
+ _fastCloner = new SPTarkov.Server.Core.Utils.Cloners.FastCloner();
+ }
+
+ [Benchmark]
+ public void JsonCloner()
+ {
+ _jsonCloner.Clone(_templates);
+ }
+
+ [Benchmark]
+ public void ReflectionsCloner()
+ {
+ _reflectionsCloner.Clone(_templates);
+ }
+
+ [Benchmark(Baseline = true)]
+ public void FastCloner()
+ {
+ _fastCloner.Clone(_templates);
+ }
+}
diff --git a/Benchmarks/Mock/MockLogger.cs b/Benchmarks/Mock/MockLogger.cs
new file mode 100644
index 00000000..1907879d
--- /dev/null
+++ b/Benchmarks/Mock/MockLogger.cs
@@ -0,0 +1,68 @@
+using SPTarkov.Server.Core.Models.Logging;
+using SPTarkov.Server.Core.Models.Spt.Logging;
+using SPTarkov.Server.Core.Models.Utils;
+
+namespace Benchmarks.Mock;
+
+public class MockLogger : ISptLogger
+{
+ public void LogWithColor(string data, LogTextColor? textColor = null, LogBackgroundColor? backgroundColor = null, Exception? ex = null)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void Success(string data, Exception? ex = null)
+ {
+ Console.WriteLine(data);
+ }
+
+ public void Error(string data, Exception? ex = null)
+ {
+ Console.WriteLine(data);
+ }
+
+ public void Warning(string data, Exception? ex = null)
+ {
+ Console.WriteLine(data);
+ }
+
+ public void Info(string data, Exception? ex = null)
+ {
+ Console.WriteLine(data);
+ }
+
+ public void Debug(string data, Exception? ex = null)
+ {
+ Console.WriteLine(data);
+ }
+
+ public void Critical(string data, Exception? ex = null)
+ {
+ Console.WriteLine(data);
+ }
+
+ public void WriteToLogFile(string body, LogLevel level = LogLevel.Info)
+ {
+ throw new NotImplementedException();
+ }
+
+ public bool IsLogEnabled(LogLevel level)
+ {
+ return false;
+ }
+
+ public void LogWithColor(
+ string data,
+ Exception? ex = null,
+ LogTextColor? textColor = null,
+ LogBackgroundColor? backgroundColor = null
+ )
+ {
+ Console.WriteLine(data);
+ }
+
+ public void WriteToLogFile(object body)
+ {
+ Console.WriteLine(body);
+ }
+}
diff --git a/Benchmarks/Program.cs b/Benchmarks/Program.cs
new file mode 100644
index 00000000..f1bfcc65
--- /dev/null
+++ b/Benchmarks/Program.cs
@@ -0,0 +1,12 @@
+using BenchmarkDotNet.Running;
+
+namespace Benchmarks;
+
+public class Program
+{
+ public static void Main(string[] args)
+ {
+ var summary = BenchmarkRunner.Run();
+ Console.WriteLine(summary);
+ }
+}
diff --git a/Build.props b/Build.props
new file mode 100644
index 00000000..8e5e1d26
--- /dev/null
+++ b/Build.props
@@ -0,0 +1,11 @@
+
+
+
+ 4.0.0-prerelease2
+ net9.0
+ latest
+ enable
+ Git
+
+
+
diff --git a/ExampleMods/ExampleMods.csproj b/ExampleMods/ExampleMods.csproj
deleted file mode 100644
index 807c933a..00000000
--- a/ExampleMods/ExampleMods.csproj
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
- Exe
- net9.0
- enable
- enable
- Library
-
-
-
-
- false
- false
- false
-
-
- false
- false
- false
-
-
- false
- false
- false
-
-
-
-
diff --git a/ExampleMods/Mods/EditConfigs.cs b/ExampleMods/Mods/EditConfigs.cs
deleted file mode 100644
index 0dea17d9..00000000
--- a/ExampleMods/Mods/EditConfigs.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-using SptCommon.Annotations;
-using Core.Models.Enums;
-using Core.Models.Spt.Config;
-using Core.Servers;
-
-namespace ExampleMods.Mods;
-
-[Injectable]
-public class EditConfigs
-{
- private readonly ConfigServer _configServer;
- private readonly BotConfig _botConfig;
- private readonly HideoutConfig _hideoutConfig;
- private readonly WeatherConfig _weatherConfig;
- private readonly AirdropConfig _airdropConfig;
- private readonly PmcChatResponse _pmcChatResponseConfig;
- private readonly QuestConfig _questConfig;
- private readonly PmcConfig _pmcConfig;
-
- // We access configs via ConfigServer
- public EditConfigs(
- ConfigServer configServer)
- {
- _configServer = configServer;
-
- // We get the bot config by calling GetConfig and passing the configs 'type' within the diamond brackets
- _botConfig = _configServer.GetConfig();
- _hideoutConfig = _configServer.GetConfig();
- _weatherConfig = _configServer.GetConfig();
- _airdropConfig = _configServer.GetConfig();
- _pmcChatResponseConfig = _configServer.GetConfig();
- _questConfig = _configServer.GetConfig();
- _pmcConfig = _configServer.GetConfig();
-
- Run();
- }
-
- public void Run()
- {
- // Let's edit the weather config to make the season winter
- _weatherConfig.OverrideSeason = Season.WINTER;
-
- // Let's edit the hideout config to Make all crafts take 60 seconds
- _hideoutConfig.OverrideCraftTimeSeconds = 60;
-
- // Let's edit the hideout config to Make all upgrades take 60 seconds
- _hideoutConfig.OverrideBuildTimeSeconds = 60;
-
- // Let's edit the airdrop config to Make weapon/armor drops really common
- _airdropConfig.AirdropTypeWeightings[SptAirdropTypeEnum.weaponArmor] = 999;
-
- // Let's edit the airdrop config to Make weapon/armor drops always have 3 sealed weapon crates
- var weaponCrateMinMax = _airdropConfig.Loot["weaponArmor"].WeaponCrateCount;
- weaponCrateMinMax.Min = 3;
- weaponCrateMinMax.Max = 3;
-
- // Let's make PMCs always mail you when they kill you
- _pmcChatResponseConfig.Killer.ResponseChancePercent = 100;
-
- // Let's make quest rewards sent to you via mail last for over a week if you have an unheard profile
- _questConfig.MailRedeemTimeHours["unheard_edition"] = 168;
-
- // Let's make the interchange bot cap huge
- _botConfig.MaxBotCap["interchange"] = 50;
-
- // Let's disable loot on scavs
- _botConfig.DisableLootOnBotTypes.Add("assault");
-
- // Let's make the conversion rate of scavs to pmcs 100% on factory day
- var factory4DayConversionSettings = _pmcConfig.ConvertIntoPmcChance["factory4_day"];
- var assaultConversionSettings = factory4DayConversionSettings["assault"];
- assaultConversionSettings.Min = 100;
- assaultConversionSettings.Max = 100;
- }
-}
diff --git a/ExampleMods/Mods/EditDatabaseValues.cs b/ExampleMods/Mods/EditDatabaseValues.cs
deleted file mode 100644
index 7acc8c12..00000000
--- a/ExampleMods/Mods/EditDatabaseValues.cs
+++ /dev/null
@@ -1,189 +0,0 @@
-using SptCommon.Annotations;
-using Core.Models.Eft.Hideout;
-using Core.Models.Enums;
-using Core.Models.Utils;
-using Core.Services;
-
-namespace ExampleMods.Mods;
-
-[Injectable]
-public class EditDatabaseValues
-{
- private readonly DatabaseService _databaseService;
-
- public EditDatabaseValues(
- DatabaseService databaseService)
- {
- _databaseService = databaseService;
-
- Run();
- }
-
- public void Run()
- {
- // When SPT starts, it stores all the data found in (SPT_Data\Server\database) in memory
- // We can use the '_databaseService' we injected to access this data, this includes files from EFT and SPT
-
- // Lets edit some globals settings to make the game easier
- EditGlobals();
-
- // Lets edit the BTR to have the christmas tarcola skin
- EditBtr();
-
- // Let's edit the hideout so it's easier to upgrade the lavatory
- EditHideout();
-
- // Lets edit the default scav to
- EditScavSettings();
-
- // Lets edit Customs
- EditCustoms();
- }
-
- private void EditGlobals()
- {
- // Let's edit settings in the GLOBALS file (database/globals.json)
- var globals = _databaseService.GetGlobals();
-
- // Let's edit the scav cooldown to be 1 second
- globals.Configuration.SavagePlayCooldown = 1;
-
-
- // Now lets try editing the ragfair unlock level, lets get the ragfair settings first
- var ragfairSettings = globals.Configuration.RagFair;
-
- // Lets set the level you need to be to access flea to be 1
- ragfairSettings.MinUserLevel = 1;
-
-
- // Now lets increase the number of offers you can have listed at one time
- // The max is stored in a list, different flea ratings give different offer amounts
-
- // We loop over all the settings, setting all of them to be 20
- foreach (var offerCountSettings in ragfairSettings.MaxActiveOfferCount) offerCountSettings.Count = 20;
- }
-
- private void EditBtr()
- {
- // BTR setting can be found in the GLOBALS file too
- var globals = _databaseService.GetGlobals();
-
- // We get the BTR settings from globals first
- var btrSettings = globals.Configuration.BTRSettings;
-
- // Let's get the settings for woods specifically, we use 'tryGetValue' for this, the settings will be stored in 'woodsBtrSettings'
- btrSettings.MapsConfigs.TryGetValue("Woods", out var woodsBtrSettings);
-
- // Lets set the BTR to use the christmas skin
- woodsBtrSettings.BtrSkin = "Tarcola";
- }
-
- private void EditHideout()
- {
- // Hideout data can be found in (SPT_Data\Server\database\hideout)
- var hideout = _databaseService.GetHideout();
-
- // We want the areas, they're stored in a list
- var hideoutAreas = hideout.Areas;
-
- // We find the toilet, we use 'firstOrDefault', if we cant find the lavatory, 'lavatoryArea' will be null
- var lavatoryArea = hideoutAreas.FirstOrDefault(area => area.Type == HideoutAreas.LAVATORY);
-
-
- // Now we have the toilet, we can find the requirements to craft, all data is stored by stage
- var toiletStages = lavatoryArea.Stages;
-
- // Stages are stored in a dictionary, a dictionary has a 'key' and a 'value'
- // In this case, the 'key' is the upgrade stage, e.g. "1", or "2"
- // We reference to each stage as a 'stageKvP' this means 'Key value Pair', every key has a value (key = stage number, value = data for that stage)
- foreach (var stageKvP in toiletStages)
- {
- // while we're here, we can make the stages craft really fast (60 seconds)
- stageKvP.Value.ConstructionTime = 60;
-
- // Let's get the stage requirements, they're a list
- var stageRequirements = stageKvP.Value.Requirements;
-
- // We empty the requirements out, now it can be built straight away
- stageRequirements.Clear();
- }
- }
-
- private void EditScavSettings()
- {
- var bots = _databaseService.GetBots();
-
- // Same as the above example, we use 'TryGetValue' to get the 'assault' bot (assault is the internal name for scavs)
- bots.Types.TryGetValue("assault", out var assaultBot);
-
- // Let's make the chance to get a good backpack really high
- assaultBot.BotInventory.Equipment.TryGetValue(EquipmentSlots.Backpack, out var backPacks);
-
- // We access the backpacks dictionary by key directly using square brackets, we use ItemTpl to get the items ID
- // Alternately, we could have typed backPacks["59e763f286f7742ee57895da"] and done the same thing, ItemTpl makes it easier to read
- backPacks[ItemTpl.BACKPACK_PILGRIM_TOURIST] = 999999;
-
-
- // Now lets make them always have an M4A1
- assaultBot.BotInventory.Equipment.TryGetValue(EquipmentSlots.FirstPrimaryWeapon, out var primaryWeapons);
-
- // We edit the weight value (pick chance) that is already there to be massive, making the item more likely to be picked
- primaryWeapons[ItemTpl.ASSAULTRIFLE_COLT_M4A1_556X45_ASSAULT_RIFLE] = 999999;
-
-
- // Now lets make them always have the first name of Gary
- // We start by removing all the existing names
- assaultBot.FirstNames.Clear();
-
- // We add the new name Gary, very menacing
- assaultBot.FirstNames.Add("Gary");
- }
-
- private void EditCustoms()
- {
- // Let's get all the maps (called locations)
- var locations = _databaseService.GetLocations();
-
- // Customs is called 'bigmap' in eft
- var customs = locations.Bigmap;
-
- // Lets get the exits and make them all 100% chance to appear
- var exits = customs.Base.Exits;
-
- // They're stored as a list so we can loop over them
- foreach (var exit in exits)
- {
- // I can't remember which one is used, you'd assume ChancePVE is used in pve, but this is BSG we're dealing with
- // So we set both
- exit.Chance = 100;
- exit.ChancePVE = 100;
- }
-
-
- // Lets try editing the airdrops on customs to be better
- var airdropSettings = customs.Base.AirdropParameters;
-
- // They're stored in an array but there's only one bunch of settings, it means we have to get the first item from the list,
- // An alternate way to access the first item is done by using square brackets with the 'index' of the item we want,
- // indexes start at 0 so we want to type "[0]" to access the first item in the list,
- var actualAirdropSettings = airdropSettings.First();
-
- // Make it spawn 100%
- actualAirdropSettings.PlaneAirdropChance = 1; // Number between 0 and 1
-
- // Make it spawn as early as start of raid
- actualAirdropSettings.PlaneAirdropStartMin = 1;
-
-
- // Let's make bosses spawn 100% of the time
-
- // We get all the bosses, they're stored in a list
- var bosses = customs.Base.BossLocationSpawn;
-
- // Let's get Reshala, we use "FirstOrDefault" and look for the first boss with the name "bossBully"
- var reshala = bosses.FirstOrDefault(boss => boss.BossName == "bossBully");
-
- // Set him to 100%
- reshala.BossChance = 100;
- }
-}
diff --git a/ExampleMods/Mods/Logging.cs b/ExampleMods/Mods/Logging.cs
deleted file mode 100644
index 8f784473..00000000
--- a/ExampleMods/Mods/Logging.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using SptCommon.Annotations;
-using Core.Models.Logging;
-using Core.Models.Utils;
-
-namespace ExampleMods.Mods;
-
-[Injectable]
-public class Logging
-{
- private readonly ISptLogger _logger;
-
- // Constructor - Inject a 'ISptLogger' with your mods Class in the diamond brackets
- public Logging(
- ISptLogger logger)
- {
- // Save the logger we're injecting into a private variable that is scoped to this class (only this class has access to it)
- _logger = logger;
-
- // Not 100% necessary but let's split our code out into a method to make it easier to read
- Run();
- }
-
- public void Run()
- {
- // We can access the logger to assigned in the constructor here
- _logger.Success("This is a success message");
- _logger.Warning("This is a warning message");
- _logger.Error("This is an error message");
- _logger.Info("This is an info message");
- _logger.Critical("this is a critical message");
-
- // Logging with colors requires you to 'pass' the text color and background color
- _logger.LogWithColor("This is a message with custom colors", LogTextColor.Red, LogBackgroundColor.Black);
- _logger.Debug("This is a debug message that gets written to the log file, not the console");
- }
-}
diff --git a/ExampleMods/Mods/Override/ExampleOverrideMod.csproj b/ExampleMods/Mods/Override/ExampleOverrideMod.csproj
deleted file mode 100644
index 3cebe147..00000000
--- a/ExampleMods/Mods/Override/ExampleOverrideMod.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- net9.0
- enable
- enable
-
-
-
-
-
-
-
diff --git a/ExampleMods/Mods/Override/WatermarkOverride.cs b/ExampleMods/Mods/Override/WatermarkOverride.cs
deleted file mode 100644
index 05c8a7df..00000000
--- a/ExampleMods/Mods/Override/WatermarkOverride.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using SptCommon.Annotations;
-using Core.Models.Utils;
-using Core.Servers;
-using Core.Services;
-using Core.Utils;
-
-namespace ExampleMods.Mods.Override;
-
-[Injectable(InjectableTypeOverride = typeof(Watermark))]
-public class WatermarkOverride(
- ISptLogger _logger,
- ConfigServer _configServer,
- LocalisationService _localisationService,
- WatermarkLocale _watermarkLocale
-) : Watermark(
- _logger,
- _configServer,
- _localisationService,
- _watermarkLocale
-) // was testing overriding with primary constructors, works fine from what i can see
-{
- public override void Initialize()
- {
- _logger.Success("This is a watermark mod override!");
- base.Initialize();
- }
-
- // public override string GetVersionTag(bool withEftVersion = false)
- // {
- // // _logger.Success("asdasdasda");
- // return base.GetVersionTag(withEftVersion);
- // }
-}
diff --git a/Libraries/Core/Callbacks/AchievementCallbacks.cs b/Libraries/Core/Callbacks/AchievementCallbacks.cs
deleted file mode 100644
index e03226dd..00000000
--- a/Libraries/Core/Callbacks/AchievementCallbacks.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using SptCommon.Annotations;
-using Core.Controllers;
-using Core.Models.Eft.Common;
-using Core.Utils;
-
-namespace Core.Callbacks;
-
-[Injectable(InjectableTypeOverride = typeof(AchievementCallbacks))]
-public class AchievementCallbacks(
- AchievementController _achievementController,
- HttpResponseUtil _httpResponseUtil
-)
-{
- ///
- /// Handle client/achievement/list
- ///
- ///
- ///
- ///
- ///
- public string GetAchievements(string url, EmptyRequestData info, string sessionID)
- {
- return _httpResponseUtil.GetBody(_achievementController.GetAchievements(sessionID));
- }
-
- ///
- /// Handle client/achievement/statistic
- ///
- ///
- ///
- ///
- ///
- public string Statistic(string url, EmptyRequestData info, string sessionID)
- {
- return _httpResponseUtil.GetBody(_achievementController.GetAchievementStatics(sessionID));
- }
-}
diff --git a/Libraries/Core/Callbacks/BuildsCallbacks.cs b/Libraries/Core/Callbacks/BuildsCallbacks.cs
deleted file mode 100644
index cfd8f64e..00000000
--- a/Libraries/Core/Callbacks/BuildsCallbacks.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using SptCommon.Annotations;
-using Core.Controllers;
-using Core.Models.Eft.Builds;
-using Core.Models.Eft.Common;
-using Core.Models.Eft.PresetBuild;
-using Core.Utils;
-
-namespace Core.Callbacks;
-
-[Injectable]
-public class BuildsCallbacks(
- HttpResponseUtil _httpResponseUtil,
- BuildController _buildController
-)
-{
- ///
- /// Handle client/builds/list
- ///
- ///
- ///
- ///
- ///
- public string GetBuilds(string url, EmptyRequestData info, string sessionID)
- {
- return _httpResponseUtil.GetBody(_buildController.GetUserBuilds(sessionID));
- }
-
- ///
- /// Handle client/builds/magazine/save
- ///
- ///
- ///
- ///
- ///
- public string CreateMagazineTemplate(string url, SetMagazineRequest info, string sessionID)
- {
- _buildController.CreateMagazineTemplate(sessionID, info);
- return _httpResponseUtil.NullResponse();
- }
-
- ///
- /// Handle client/builds/weapon/save
- ///
- ///
- ///
- ///
- ///
- public string SetWeapon(string url, PresetBuildActionRequestData info, string sessionID)
- {
- _buildController.SaveWeaponBuild(sessionID, info);
- return _httpResponseUtil.NullResponse();
- }
-
- ///
- /// Handle client/builds/equipment/save
- ///
- ///
- ///
- ///
- ///
- public string SetEquipment(string url, PresetBuildActionRequestData info, string sessionID)
- {
- _buildController.SaveEquipmentBuild(sessionID, info);
- return _httpResponseUtil.NullResponse();
- }
-
- ///
- /// Handle client/builds/delete
- ///
- ///
- ///
- ///
- ///
- public string DeleteBuild(string url, RemoveBuildRequestData info, string sessionID)
- {
- _buildController.RemoveBuild(sessionID, info);
- return _httpResponseUtil.NullResponse();
- }
-}
diff --git a/Libraries/Core/Callbacks/BundleCallbacks.cs b/Libraries/Core/Callbacks/BundleCallbacks.cs
deleted file mode 100644
index fa0b4549..00000000
--- a/Libraries/Core/Callbacks/BundleCallbacks.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using SptCommon.Annotations;
-using Core.Models.Eft.Common;
-using Core.Utils;
-
-namespace Core.Callbacks;
-
-[Injectable(InjectableTypeOverride = typeof(BundleCallbacks))]
-public class BundleCallbacks(
- HttpResponseUtil _httpResponseUtil
- // BundleLoader _bundleLoader,
-)
-{
- ///
- /// Handle singleplayer/bundles
- ///
- ///
- ///
- ///
- ///
- public string GetBundles(string url, EmptyRequestData info, string sessionID)
- {
- // return _httpResponseUtil.NoBody(_bundleLoader.GetBundles());
- return _httpResponseUtil.NoBody(new List