diff --git a/Libraries/Core/Core.csproj b/Libraries/Core/Core.csproj index db9fa47b..ee09f938 100644 --- a/Libraries/Core/Core.csproj +++ b/Libraries/Core/Core.csproj @@ -3,7 +3,7 @@ SPTarkov.Server.Core Single Player Tarkov - Core libaries for the Single Player Tarkov server. + Core library for the Single Player Tarkov server. Copyright (c) Single Player Tarkov 2025 LICENSE https://sp-tarkov.com diff --git a/Libraries/SptAssets/SptAssets.csproj b/Libraries/SptAssets/SptAssets.csproj index 60917d62..156f9685 100644 --- a/Libraries/SptAssets/SptAssets.csproj +++ b/Libraries/SptAssets/SptAssets.csproj @@ -1,9 +1,14 @@  - SPT.Assets - SPT Team + SPTarkov.Server.Assets + Single Player Tarkov + Asset library for the Single Player Tarkov server. + Copyright (c) Single Player Tarkov 2025 + LICENSE + https://sp-tarkov.com https://github.com/sp-tarkov/server-csharp + git net9.0 enable enable @@ -19,4 +24,8 @@ + + + + diff --git a/Libraries/SptCommon/SptCommon.csproj b/Libraries/SptCommon/SptCommon.csproj index ec0bae52..d3a34661 100644 --- a/Libraries/SptCommon/SptCommon.csproj +++ b/Libraries/SptCommon/SptCommon.csproj @@ -1,9 +1,14 @@  - SPT.Common - SPT Team + SPTarkov.Common + Single Player Tarkov + Common shared library for the Single Player Tarkov projects. + Copyright (c) Single Player Tarkov 2025 + LICENSE + https://sp-tarkov.com https://github.com/sp-tarkov/server-csharp + git net9.0 enable enable @@ -15,4 +20,8 @@ + + + + diff --git a/Libraries/SptDependencyInjection/SptDependencyInjection.csproj b/Libraries/SptDependencyInjection/SptDependencyInjection.csproj index 8983160a..a7e0b37b 100644 --- a/Libraries/SptDependencyInjection/SptDependencyInjection.csproj +++ b/Libraries/SptDependencyInjection/SptDependencyInjection.csproj @@ -1,9 +1,14 @@  - SPT.Server.DI - SPT Team + SPTarkov.DI + Single Player Tarkov + Dependency injection shared library for the Single Player Tarkov projects. + Copyright (c) Single Player Tarkov 2025 + LICENSE + https://sp-tarkov.com https://github.com/sp-tarkov/server-csharp + git net9.0 enable enable @@ -19,4 +24,8 @@ + + + + diff --git a/ModExamples/10CustomRoute/10CustomRoute.csproj b/ModExamples/10CustomRoute/10CustomRoute.csproj deleted file mode 100644 index 21e2e89f..00000000 --- a/ModExamples/10CustomRoute/10CustomRoute.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _10CustomRoute - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/10CustomRoute/CustomStaticRouter.cs b/ModExamples/10CustomRoute/CustomStaticRouter.cs deleted file mode 100644 index dd7a4999..00000000 --- a/ModExamples/10CustomRoute/CustomStaticRouter.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Core.DI; -using Core.Models.Utils; -using Core.Utils; -using SptCommon.Annotations; - -namespace _10CustomRoute; - -// Flag our mod as a type of static router -[Injectable(InjectableTypeOverride = typeof(StaticRouter))] -public class CustomStaticRouter : StaticRouter -{ - public CustomStaticRouter( - JsonUtil jsonUtil) : base( - jsonUtil, - // Add an array of routes we want to add - GetCustomRoutes() - ) - { - } - - private static List GetCustomRoutes() - { - return - [ - new RouteAction( - "/example/route/static", - ( - url, - info, - sessionId, - output - ) => HandleRoute(url, info as ExampleStaticRequestData, sessionId) - ) - ]; - } - - private static string HandleRoute(string url, ExampleStaticRequestData info, string sessionId) - { - // Stuff goes here - - return string.Empty; - } -} -public class ExampleStaticRequestData : IRequestData -{ -} diff --git a/ModExamples/10CustomRoute/package.json b/ModExamples/10CustomRoute/package.json deleted file mode 100644 index 92408068..00000000 --- a/ModExamples/10CustomRoute/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "10CustomStaticRouter", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/11RegisterClassesInDI/11RegisterClassesInDI.csproj b/ModExamples/11RegisterClassesInDI/11RegisterClassesInDI.csproj deleted file mode 100644 index 53c851a6..00000000 --- a/ModExamples/11RegisterClassesInDI/11RegisterClassesInDI.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _11RegisterClassesInDI - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/11RegisterClassesInDI/RegisterClassesInDI.cs b/ModExamples/11RegisterClassesInDI/RegisterClassesInDI.cs deleted file mode 100644 index 836a90b8..00000000 --- a/ModExamples/11RegisterClassesInDI/RegisterClassesInDI.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Core.Models.External; -using Core.Models.Utils; -using SptCommon.Annotations; - -namespace _11RegisterClassesInDI; - -[Injectable] -public class Bundle : IPostDBLoadMod // Run after db has loaded -{ - private readonly SingletonClassExample _singletonClassExample; - private readonly TransientClassExample _transientClassExample; - - // We inject 2 classes (singleton and transient) we've made below - public Bundle( - SingletonClassExample singletonClassExample, - TransientClassExample transientClassExample) - { - _singletonClassExample = singletonClassExample; - _transientClassExample = transientClassExample; - } - - public void PostDBLoad() - { - _singletonClassExample.IncrementCounterAndLog(); - _singletonClassExample.IncrementCounterAndLog(); - _singletonClassExample.IncrementCounterAndLog(); - - _transientClassExample.IncrementCounterAndLog(); - _transientClassExample.IncrementCounterAndLog(); - _transientClassExample.IncrementCounterAndLog(); - } -} - -// This class is registered as a singleton. This means ONE and only ONE instance -// of this class will ever exist. -[Injectable(InjectionType.Singleton)] -public class SingletonClassExample -{ - private readonly ISptLogger _logger; - private int _counter; - - public SingletonClassExample( - ISptLogger logger) - { - _logger = logger; - _counter = 0; - } - - public void IncrementCounterAndLog() - { - _counter++; - _logger.Success($"{_counter}"); - } -} - -// This class is being registered as default or transient. This means that -// every time a class requests an instance of this type a new one will be created -[Injectable(InjectionType.Transient)] // [Injectable] is the same as doing this -public class TransientClassExample -{ - private readonly ISptLogger _logger; - private int _counter; - - public TransientClassExample( - ISptLogger logger) - { - _logger = logger; - _counter = 0; - } - - public void IncrementCounterAndLog() - { - _counter++; - _logger.Success($"{_counter}"); - } -} diff --git a/ModExamples/11RegisterClassesInDI/package.json b/ModExamples/11RegisterClassesInDI/package.json deleted file mode 100644 index 8c61a565..00000000 --- a/ModExamples/11RegisterClassesInDI/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "11RegisterClassesInDI", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/12Bundle/12Bundle.csproj b/ModExamples/12Bundle/12Bundle.csproj deleted file mode 100644 index cd0531da..00000000 --- a/ModExamples/12Bundle/12Bundle.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _12Bundle - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/12Bundle/Bundle.cs b/ModExamples/12Bundle/Bundle.cs deleted file mode 100644 index 25dbb6ab..00000000 --- a/ModExamples/12Bundle/Bundle.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Reflection; -using Core.Loaders; -using Core.Models.External; -using SptCommon.Annotations; - -namespace _12Bundle; - -[Injectable] -public class Bundle : IPostDBLoadMod -{ - private readonly BundleLoader _bundleLoader; - - public Bundle( - BundleLoader bundleLoader) - { - _bundleLoader = bundleLoader; - } - - public void PostDBLoad() - { - // must be a relative path. - // for example "./user/mods/Mod3" - // . being the server.exe or root directory - // follow all the way to your mods folder name - // you will be only changing from "./user/mods/" onwards - _bundleLoader.AddBundles("./user/mods/Mod3"); - } -} diff --git a/ModExamples/12Bundle/bundles.json b/ModExamples/12Bundle/bundles.json deleted file mode 100644 index 536c4046..00000000 --- a/ModExamples/12Bundle/bundles.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "manifest": [ - { - "key": "assets/content/weapons/usable_items/item_bottle/textures/client_assets.bundle", - "dependencyKeys": [] - } - ] -} diff --git a/ModExamples/12Bundle/bundles/assets/content/weapons/usable_items/item_bottle/textures/client_assets.bundle b/ModExamples/12Bundle/bundles/assets/content/weapons/usable_items/item_bottle/textures/client_assets.bundle deleted file mode 100644 index 782eff68..00000000 Binary files a/ModExamples/12Bundle/bundles/assets/content/weapons/usable_items/item_bottle/textures/client_assets.bundle and /dev/null differ diff --git a/ModExamples/12Bundle/package.json b/ModExamples/12Bundle/package.json deleted file mode 100644 index 1244cf43..00000000 --- a/ModExamples/12Bundle/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "12Bundle", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": true, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/12Bundle/patron_1143x33mmr_lead.bundle b/ModExamples/12Bundle/patron_1143x33mmr_lead.bundle deleted file mode 100644 index ef204b85..00000000 Binary files a/ModExamples/12Bundle/patron_1143x33mmr_lead.bundle and /dev/null differ diff --git a/ModExamples/13.1AddTraderWithDynamicAssorts/13.1AddTraderWithDynamicAssorts.csproj b/ModExamples/13.1AddTraderWithDynamicAssorts/13.1AddTraderWithDynamicAssorts.csproj deleted file mode 100644 index b0bd6f60..00000000 --- a/ModExamples/13.1AddTraderWithDynamicAssorts/13.1AddTraderWithDynamicAssorts.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _13._1AddTraderWithDynamicAssorts - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/13.1AddTraderWithDynamicAssorts/AddTraderHelper.cs b/ModExamples/13.1AddTraderWithDynamicAssorts/AddTraderHelper.cs deleted file mode 100644 index 6fdc1824..00000000 --- a/ModExamples/13.1AddTraderWithDynamicAssorts/AddTraderHelper.cs +++ /dev/null @@ -1,181 +0,0 @@ -using Core.Models.Common; -using Core.Models.Eft.Common.Tables; -using Core.Models.Spt.Config; -using Core.Models.Spt.Server; -using Core.Utils; -using Core.Utils.Cloners; - -namespace _13._1AddTraderWithDynamicAssorts -{ - public class AddTraderHelper - { - /** - * Add record to trader config to set the refresh time of trader in seconds (default is 60 minutes) - * @param traderConfig trader config to add our trader to - * @param baseJson json file for trader (db/base.json) - * @param refreshTimeSecondsMin How many seconds between trader stock refresh min time - * @param refreshTimeSecondsMax How many seconds between trader stock refresh max time - */ - public void SetTraderUpdateTime(TraderConfig traderConfig, TraderBase baseJson, int refreshTimeSecondsMin, int refreshTimeSecondsMax) - { - // Add refresh time in seconds to config - var traderRefreshRecord = new UpdateTime - { - TraderId = baseJson.Id, - Seconds = new MinMax(refreshTimeSecondsMin, refreshTimeSecondsMax) - }; - - - traderConfig.UpdateTime.Add(traderRefreshRecord); - } - - /** - * Add our new trader to the database - * @param traderDetailsToAdd trader details - * @param tables database - * @param jsonUtil json utility class - */ - public void AddTraderToDb(TraderBase traderDetailsToAdd, DatabaseTables tables, ICloner cloner, TraderAssort assort) - { - // Create trader data ready to add to database - var traderDataToAdd = new Trader - { - Assort = cloner.Clone(assort), - Base = cloner.Clone(traderDetailsToAdd), - QuestAssort = new Dictionary> // quest assort is empty as trader has no assorts unlocked by quests - { - { "Started", new Dictionary() }, - { "Success", new Dictionary() }, - { "Fail", new Dictionary() } - } - }; - - // Add trader to trader table, key is the traders id - tables.Traders.Add(traderDetailsToAdd.Id, traderDataToAdd); - } - - /** - * Add traders name/location/description to the locale table - * @param baseJson json file for trader (db/base.json) - * @param tables database tables - * @param fullName Complete name of trader - * @param firstName First name of trader - * @param nickName Nickname of trader - * @param location Location of trader (e.g. "Here in the cat shop") - * @param description Description of trader - */ - public void AddTraderToLocales(TraderBase baseJson, DatabaseTables tables, string fullName, string firstName, string nickName, string location, string description) - { - // For each language, add locale for the new trader - var locales = tables.Locales.Global; - - foreach (var (key, value) in locales) { - value.Value[$"{baseJson.Id} FullName"] = fullName; - value.Value[$"{baseJson.Id} FirstName"] = firstName; - value.Value[$"{baseJson.Id} Nickname"] = nickName; - value.Value[$"{baseJson.Id} Location"] = location; - value.Value[$"{baseJson.Id} Description"] = description; - } - } - - public List CreateGlock() - { - // Create an array ready to hold weapon + all mods - var glock = new List(); - - // Add the base first - glock.Add(new Item { // Add the base weapon first - Id = - NewItemIds.GLOCK_BASE, // Ids matter, MUST BE UNIQUE - Template = - "5a7ae0c351dfba0017554310", // This is the weapons tpl, found on: https://db.sp-tarkov.com/search - }); - - // Add barrel - glock.Add(new Item { - Id = - NewItemIds.GLOCK_BARREL, - Template = - "5a6b60158dc32e000a31138b", - ParentId = - NewItemIds.GLOCK_BASE, // This is a sub item, you need to define its parent its attached to / inserted into - SlotId = - "mod_barrel", // Required for mods, you need to define what 'slot' the mod will fill on the weapon - }); - - // Add receiver - glock.Add( new Item { - Id = - NewItemIds.GLOCK_RECIEVER, - Template = - "5a9685b1a2750c0032157104", - ParentId = - NewItemIds.GLOCK_BASE, - SlotId = - "mod_reciever", - }); - - // Add compensator - glock.Add(new Item { - Id = - NewItemIds.GLOCK_COMPENSATOR, - Template = - "5a7b32a2e899ef00135e345a", - ParentId = - NewItemIds.GLOCK_RECIEVER, // The parent of this mod is the receiver NOT weapon, be careful to get the correct parent - SlotId = - "mod_muzzle", - }); - - // Add Pistol grip - glock.Add(new Item { - Id = - NewItemIds.GLOCK_PISTOL_GRIP, - Template = - "5a7b4960e899ef197b331a2d", - ParentId = - NewItemIds.GLOCK_BASE, - SlotId = - "mod_pistol_grip", - }); - - // Add front sight - glock.Add(new Item { - Id = - NewItemIds.GLOCK_FRONT_SIGHT, - Template = - "5a6f5d528dc32e00094b97d9", - ParentId = - NewItemIds.GLOCK_RECIEVER, - SlotId = - "mod_sight_rear", - }); - - // Add rear sight - glock.Add(new Item { - Id = - NewItemIds.GLOCK_REAR_SIGHT, - Template = - "5a6f58f68dc32e000a311390", - ParentId = - NewItemIds.GLOCK_RECIEVER, - SlotId = - "mod_sight_front", - }); - - // Add magazine - glock.Add(new Item { - Id = - NewItemIds.GLOCK_MAGAZINE, - Template = - "630769c4962d0247b029dc60", - ParentId = - NewItemIds.GLOCK_BASE, - SlotId = - "mod_magazine", - }); - - return glock; - } - } -} diff --git a/ModExamples/13.1AddTraderWithDynamicAssorts/AddTraderWithDynamicAssorts.cs b/ModExamples/13.1AddTraderWithDynamicAssorts/AddTraderWithDynamicAssorts.cs deleted file mode 100644 index bc054e09..00000000 --- a/ModExamples/13.1AddTraderWithDynamicAssorts/AddTraderWithDynamicAssorts.cs +++ /dev/null @@ -1,145 +0,0 @@ -using Core.Helpers; -using System.Reflection; -using Core.Models.Eft.Common.Tables; -using Core.Models.Enums; -using Core.Models.External; -using Core.Models.Spt.Config; -using Core.Models.Utils; -using Core.Routers; -using Core.Servers; -using Core.Services; -using Core.Utils; -using Core.Utils.Cloners; -using SptCommon.Annotations; -using Path = System.IO.Path; - -namespace _13._1AddTraderWithDynamicAssorts; - -[Injectable] -public class AddTraderWithDynamicAssorts : IPostDBLoadMod -{ - private readonly ISptLogger _logger; - private readonly ModHelper _modHelper; - private readonly HashUtil _hashUtil; - private readonly JsonUtil _jsonUtil; - private readonly FileUtil _fileUtil; - private readonly DatabaseService _databaseService; - private readonly ImageRouter _imageRouter; - private readonly ConfigServer _configServer; - private readonly ICloner _cloner; - private readonly TraderConfig _traderConfig; - private readonly RagfairConfig _ragfairConfig; - - // This MUST match the folder name of the mod in the user/mods folder - private const string _modName = "13.1AddTraderWithDynamicAssorts"; - - public AddTraderWithDynamicAssorts( - ISptLogger logger, - ModHelper modHelper, - HashUtil hashUtil, - JsonUtil jsonUtil, - FileUtil fileUtil, - DatabaseService databaseService, - ImageRouter imageRouter, - ConfigServer configServer, - ICloner cloner ) - { - _logger = logger; - _modHelper = modHelper; - _hashUtil = hashUtil; - _jsonUtil = jsonUtil; - _fileUtil = fileUtil; - _databaseService = databaseService; - _imageRouter = imageRouter; - _configServer = configServer; - _cloner = cloner; - - _traderConfig = _configServer.GetConfig(); - _ragfairConfig = _configServer.GetConfig(); - } - - public void PostDBLoad() - { - var pathToMod = _modHelper.GetAbsolutePathToModFolder(Assembly.GetExecutingAssembly()); - - var traderImagePath = Path.Combine(pathToMod, "db/cat.jpg"); - var traderBase = _modHelper.GetJsonDataFromFile(pathToMod, "db/base.json"); - - // Create helper class and use it to register our traders image/icon + set its stock refresh time - var addTraderHelper = new AddTraderHelper(); - _imageRouter.AddRoute(traderBase.Avatar.Replace(".jpg", ""), traderImagePath); - addTraderHelper.SetTraderUpdateTime(_traderConfig, traderBase, 3600, 4000); - - // Add trader to flea market - _ragfairConfig.Traders[traderBase.Id] = true; - - // Get a reference to the database tables - var tables = _databaseService.GetTables(); - - addTraderHelper.AddTraderToDb( - traderBase, - _databaseService.GetTables(), - _cloner, - new TraderAssort {Items = [], BarterScheme = new Dictionary>>(), LoyalLevelItems = new Dictionary()}); - _logger.Success("added trader base"); - var fluentAssortCreator = new FluentTraderAssortCreator(_logger, _hashUtil); - - // Add milk - fluentAssortCreator - .CreateSingleAssortItem(ItemTpl.DRINK_PACK_OF_MILK) - .AddStackCount(200) - .AddBuyRestriction(10) - .AddMoneyCost(Money.ROUBLES, 2000) - .AddLoyaltyLevel(1) - .Export(tables.Traders[traderBase.Id]); - - // Add 3x bitcoin + salewa for milk barter - fluentAssortCreator - .CreateSingleAssortItem(ItemTpl.DRINK_PACK_OF_MILK) - .AddStackCount(100) - .AddBarterCost(ItemTpl.BARTER_PHYSICAL_BITCOIN, 3) - .AddBarterCost(ItemTpl.MEDKIT_SALEWA_FIRST_AID_KIT, 1) - .AddLoyaltyLevel(1) - .Export(tables.Traders[traderBase.Id]); - - - // Add glock as a money purchase - fluentAssortCreator - .CreateComplexAssortItem(addTraderHelper.CreateGlock()) - .AddUnlimitedStackCount() - .AddMoneyCost(Money.ROUBLES, 20000) - .AddBuyRestriction(3) - .AddLoyaltyLevel(1) - .Export(tables.Traders[traderBase.Id]); - - // Add mp133 preset as a barter for mayonase - fluentAssortCreator - .CreateComplexAssortItem(tables.Globals.ItemPresets["584148f2245977598f1ad387"].Items) // Weapon preset id comes from globals.json - .AddStackCount(200) - .AddBarterCost(ItemTpl.FOOD_JAR_OF_DEVILDOG_MAYO, 1) - .AddBuyRestriction(3) - .AddLoyaltyLevel(1) - .Export(tables.Traders[traderBase.Id]); - - addTraderHelper.AddTraderToLocales( - traderBase, - _databaseService.GetTables(), - traderBase.Name, - "Cat", - traderBase.Nickname, - traderBase.Location, - "This is the cat shop. Meow."); - } -} - -public static class NewItemIds -{ - public static string GLOCK_BASE = "66eeef3b2a166b73d2066a74"; - public static string GLOCK_BARREL = "66eeef3b2a166b73d2066a75"; - public static string GLOCK_RECIEVER = "66eeef3b2a166b73d2066a76"; - public static string GLOCK_COMPENSATOR = "66eeef3b2a166b73d2066a77"; - public static string GLOCK_PISTOL_GRIP = "66eeef3b2a166b73d2066a78"; - public static string GLOCK_REAR_SIGHT = "66eeef3b2a166b73d2066a79"; - public static string GLOCK_FRONT_SIGHT = "66eeef3b2a166b73d2066a7a"; - public static string GLOCK_MAGAZINE = "66eeef3b2a166b73d2066a7b"; -} diff --git a/ModExamples/13.1AddTraderWithDynamicAssorts/FluentTraderAssortCreator.cs b/ModExamples/13.1AddTraderWithDynamicAssorts/FluentTraderAssortCreator.cs deleted file mode 100644 index 88766830..00000000 --- a/ModExamples/13.1AddTraderWithDynamicAssorts/FluentTraderAssortCreator.cs +++ /dev/null @@ -1,172 +0,0 @@ -using Core.Models.Eft.Common.Tables; -using Core.Models.Utils; -using Core.Utils; - -namespace _13._1AddTraderWithDynamicAssorts; - -public class FluentTraderAssortCreator -{ - private readonly ISptLogger _logger; - private readonly HashUtil _hashUtil; - - private readonly List _itemsToSell = []; - private readonly Dictionary>> _barterScheme = new(); - private readonly Dictionary _loyaltyLevel = new(); - - public FluentTraderAssortCreator( - ISptLogger logger, - HashUtil hashUtil) - { - _logger = logger; - _hashUtil = hashUtil; - } - - public FluentTraderAssortCreator CreateSingleAssortItem(string itemTpl, string? itemId = null) - { - // Create item ready for insertion into assort table - var newItemToAdd = new Item - { - Id = itemId ?? _hashUtil.Generate(), - Template = itemTpl, - ParentId = "hideout", // Should always be "hideout" - SlotId = "hideout", // Should always be "hideout" - Upd = new Upd - { - UnlimitedCount = false, - StackObjectsCount = 100 - } - }; - - _itemsToSell.Add(newItemToAdd); - - return this; - } - - public FluentTraderAssortCreator CreateComplexAssortItem(List items) - { - items[0].ParentId = "hideout"; - items[0].SlotId = "hideout"; - - items[0].Upd ??= new Upd(); - - items[0].Upd.UnlimitedCount = false; - items[0].Upd.StackObjectsCount = 100; - - _itemsToSell.AddRange(items); - - return this; - } - - public FluentTraderAssortCreator AddStackCount(int stackCount) - { - _itemsToSell[0].Upd.StackObjectsCount = stackCount; - - return this; - } - - public FluentTraderAssortCreator AddUnlimitedStackCount() - { - _itemsToSell[0].Upd.StackObjectsCount = 999999; - _itemsToSell[0].Upd.UnlimitedCount = true; - - return this; - } - - public FluentTraderAssortCreator MakeStackCountUnlimited() - { - _itemsToSell[0].Upd.StackObjectsCount = 999999; - - return this; - } - - public FluentTraderAssortCreator AddBuyRestriction(int maxBuyLimit) - { - _itemsToSell[0].Upd.BuyRestrictionMax = maxBuyLimit; - _itemsToSell[0].Upd.BuyRestrictionCurrent = 0; - - return this; - } - - public FluentTraderAssortCreator AddLoyaltyLevel(int level) - { - _loyaltyLevel[_itemsToSell[0].Id] = level; - - return this; - } - - public FluentTraderAssortCreator AddMoneyCost(string currencyType, int amount) - { - var dataToAdd = new BarterScheme - { - Count = amount, - Template = currencyType - }; - - _barterScheme.Add(_itemsToSell[0].Id, [[dataToAdd]]); - - return this; - } - - public FluentTraderAssortCreator AddBarterCost(string itemTpl, int count) - { - var sellableItemId = _itemsToSell[0].Id; - - // No data at all, create - if (_barterScheme.Count == 0) - { - var dataToAdd = new BarterScheme - { - Count = count, - Template = itemTpl - }; - - _barterScheme[sellableItemId] = [[dataToAdd]]; - } - else - { - // Item already exists, add to - var existingData = _barterScheme[sellableItemId][0].FirstOrDefault(x => x.Template == itemTpl); - if (existingData is not null) - { - // itemtpl already a barter for item, add to count - existingData.Count += count; - } - else - { - // No barter for item, add it fresh - _barterScheme[sellableItemId][0].Add(new BarterScheme - { - Count = count, - Template = itemTpl - }); - } - } - - return this; - } - - /** - * Reset objet ready for reuse - * @returns - */ - public FluentTraderAssortCreator? Export(Trader data) - { - var itemBeingSoldId = _itemsToSell[0].Id; - if (!data.Assort.Items.Exists(x => x.Id == itemBeingSoldId)) - { - _logger.Error($"Unable to add complex item with item key: {_itemsToSell[0].Id}, key already used"); - - return null; - } - - data.Assort.Items.AddRange(_itemsToSell); - data.Assort.BarterScheme[itemBeingSoldId] = _barterScheme[itemBeingSoldId]; - data.Assort.LoyalLevelItems[itemBeingSoldId] = _loyaltyLevel[itemBeingSoldId]; - - _itemsToSell.Clear(); - _barterScheme.Clear(); - _loyaltyLevel.Clear(); - - return this; - } -} diff --git a/ModExamples/13.1AddTraderWithDynamicAssorts/db/base.json b/ModExamples/13.1AddTraderWithDynamicAssorts/db/base.json deleted file mode 100644 index 6b636e26..00000000 --- a/ModExamples/13.1AddTraderWithDynamicAssorts/db/base.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_id": "66eeef8b2a166b73d2066a7e", - "working": true, - "availableInRaid": false, - "items_buy": { - "category": [ - "5422acb9af1c889c16000029", - "5448e8d04bdc2ddf718b4569" - ], - "id_list": [] - }, - "items_buy_prohibited": {}, - "customization_seller": false, - "name": "Cat", - "surname": " ", - "nickname": "Maxwell", - "location": "Downtown tarkov", - "avatar": "/files/trader/avatar/cat.jpg", - "balance_rub": 5000000, - "balance_dol": 0, - "balance_eur": 0, - "unlockedByDefault": true, - "discount": 0, - "discount_end": 0, - "buyer_up": true, - "currency": "RUB", - "nextResupply": 1615141448, - "repair": { - "availability": false, - "quality": "2", - "excluded_id_list": [], - "excluded_category": [], - "currency": "5449016a4bdc2d6f028b456f", - "currency_coefficient": 1, - "price_rate": 10 - }, - "insurance": { - "availability": false, - "min_payment": 0, - "min_return_hour": 0, - "max_return_hour": 0, - "max_storage_time": 99, - "excluded_category": [] - }, - "gridHeight": 150, - "loyaltyLevels": [{ - "minLevel": 1, - "minSalesSum": 0, - "minStanding": 0, - "buy_price_coef": 38, - "repair_price_coef": 175, - "insurance_price_coef": 10, - "exchange_price_coef": 0, - "heal_price_coef": 0 - } - ], - "sell_category": [ - "575146b724597720a27126d5", - "635a758bfefc88a93f021b8a", - "55d45d3f4bdc2d972f8b456c", - "5b363dd25acfc4001a598fd2", - "5d1b36a186f7742523398433", - "59e3577886f774176a362503", - "5d6e67fba4b9361bc73bc779" - ] -} diff --git a/ModExamples/13.1AddTraderWithDynamicAssorts/package.json b/ModExamples/13.1AddTraderWithDynamicAssorts/package.json deleted file mode 100644 index e057ccda..00000000 --- a/ModExamples/13.1AddTraderWithDynamicAssorts/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "13.1AddTraderWithDynamicAssorts", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/13AddTraderWithAssortJson/13AddTraderWithAssortJson.csproj b/ModExamples/13AddTraderWithAssortJson/13AddTraderWithAssortJson.csproj deleted file mode 100644 index 1a398a42..00000000 --- a/ModExamples/13AddTraderWithAssortJson/13AddTraderWithAssortJson.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _13AddTraderWithAssortJson - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/13AddTraderWithAssortJson/AddTraderHelper.cs b/ModExamples/13AddTraderWithAssortJson/AddTraderHelper.cs deleted file mode 100644 index 842d021f..00000000 --- a/ModExamples/13AddTraderWithAssortJson/AddTraderHelper.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Core.Models.Common; -using Core.Models.Eft.Common.Tables; -using Core.Models.Spt.Config; -using Core.Models.Spt.Server; -using Core.Utils; -using Core.Utils.Cloners; - -namespace _13AddTraderWithAssortJson -{ - public class AddTraderHelper - { - /** - * Add record to trader config to set the refresh time of trader in seconds (default is 60 minutes) - * @param traderConfig trader config to add our trader to - * @param baseJson json file for trader (db/base.json) - * @param refreshTimeSecondsMin How many seconds between trader stock refresh min time - * @param refreshTimeSecondsMax How many seconds between trader stock refresh max time - */ - public void SetTraderUpdateTime(TraderConfig traderConfig, TraderBase baseJson, int refreshTimeSecondsMin, int refreshTimeSecondsMax) - { - // Add refresh time in seconds to config - var traderRefreshRecord = new UpdateTime - { - TraderId = baseJson.Id, - Seconds = new MinMax(refreshTimeSecondsMin, refreshTimeSecondsMax) - }; - - - traderConfig.UpdateTime.Add(traderRefreshRecord); - } - - /** - * Add our new trader to the database - * @param traderDetailsToAdd trader details - * @param tables database - * @param jsonUtil json utility class - */ - public void AddTraderToDb(TraderBase traderDetailsToAdd, DatabaseTables tables, ICloner cloner, TraderAssort assortJson) - { - // Create trader data ready to add to database - var traderDataToAdd = new Trader - { - Assort = cloner.Clone(assortJson), // Clone the data before saving it so we dont mess up any references - Base = cloner.Clone(traderDetailsToAdd), - QuestAssort = new Dictionary> // questassort is empty as trader has no assorts unlocked by quests - { - { "Started", new Dictionary() }, - { "Success", new Dictionary() }, - { "Fail", new Dictionary() } - } - }; - - // Add trader to trader table, key is the traders id - tables.Traders.Add(traderDetailsToAdd.Id, traderDataToAdd); - } - - /** - * Add traders name/location/description to the locale table - * @param baseJson json file for trader (db/base.json) - * @param tables database tables - * @param fullName Complete name of trader - * @param firstName First name of trader - * @param nickName Nickname of trader - * @param location Location of trader (e.g. "Here in the cat shop") - * @param description Description of trader - */ - public void AddTraderToLocales(TraderBase baseJson, DatabaseTables tables, string fullName, string firstName, string nickName, string location, string description) - { - // For each language, add locale for the new trader - var locales = tables.Locales.Global; - - foreach (var (key, value) in locales) { - value.Value[$"{baseJson.Id} FullName"] = fullName; - value.Value[$"{baseJson.Id} FirstName"] = firstName; - value.Value[$"{baseJson.Id} Nickname"] = nickName; - value.Value[$"{baseJson.Id} Location"] = location; - value.Value[$"{baseJson.Id} Description"] = description; - } - } - } -} diff --git a/ModExamples/13AddTraderWithAssortJson/AddTraderWithAssortJson.cs b/ModExamples/13AddTraderWithAssortJson/AddTraderWithAssortJson.cs deleted file mode 100644 index a4765d32..00000000 --- a/ModExamples/13AddTraderWithAssortJson/AddTraderWithAssortJson.cs +++ /dev/null @@ -1,89 +0,0 @@ -using Core.Helpers; -using System.Reflection; -using Core.Models.Eft.Common.Tables; -using Core.Models.External; -using Core.Models.Spt.Config; -using Core.Models.Utils; -using Core.Routers; -using Core.Servers; -using Core.Services; -using Core.Utils.Cloners; -using SptCommon.Annotations; -using Path = System.IO.Path; - -namespace _13AddTraderWithAssortJson; - -[Injectable] -public class AddTraderWithAssortJson : IPostDBLoadMod -{ - private readonly ISptLogger _logger; - private readonly ModHelper _modHelper; - private readonly DatabaseService _databaseService; - private readonly ImageRouter _imageRouter; - private readonly ConfigServer _configServer; - private readonly ICloner _cloner; - private readonly TraderConfig _traderConfig; - private readonly RagfairConfig _ragfairConfig; - - public AddTraderWithAssortJson( - ISptLogger logger, - ModHelper modHelper, - DatabaseService databaseService, - ImageRouter imageRouter, - ConfigServer configServer, - ICloner cloner) - { - _logger = logger; - _modHelper = modHelper; - _databaseService = databaseService; - _imageRouter = imageRouter; - _configServer = configServer; - _cloner = cloner; - - _traderConfig = _configServer.GetConfig(); - _ragfairConfig = _configServer.GetConfig(); - } - - public void PostDBLoad() - { - var pathToMod = _modHelper.GetAbsolutePathToModFolder(Assembly.GetExecutingAssembly()); - - var traderImagePath = Path.Combine(pathToMod, "db/cat.jpg"); - var traderBase = _modHelper.GetJsonDataFromFile(pathToMod, "db/base.json"); - - var assort = _modHelper.GetJsonDataFromFile(pathToMod, "db/assort.json"); - - // Create helper class and use it to register our traders image/icon + set its stock refresh time - var addTraderHelper = new AddTraderHelper(); - _imageRouter.AddRoute(traderBase.Avatar.Replace(".jpg", ""), traderImagePath); - addTraderHelper.SetTraderUpdateTime(_traderConfig, traderBase, 3600, 4000); - - // Add trader to flea market - _ragfairConfig.Traders[traderBase.Id] = true; - - // Add new trader to the trader dictionary in DatabaseServer - this is where the assort json is loaded - /* - * The assortJSON includes the following: - * Milk available for roubles at LL1 - * Milk available for item barter at LL1 - * Helmet w/ soft armour available for roubles at LL1 - * Helmet w/ soft armour available for item barter at LL1 - * - * It is *REQUIRED* to use MongoIDs for IDs in the assort - */ - addTraderHelper.AddTraderToDb( - traderBase, - _databaseService.GetTables(), - _cloner, - assort); - - addTraderHelper.AddTraderToLocales( - traderBase, - _databaseService.GetTables(), - traderBase.Name, - "Cat", - traderBase.Nickname, - traderBase.Location, - "This is the cat shop. Meow."); - } -} diff --git a/ModExamples/13AddTraderWithAssortJson/data/assort.json b/ModExamples/13AddTraderWithAssortJson/data/assort.json deleted file mode 100644 index d7321ed0..00000000 --- a/ModExamples/13AddTraderWithAssortJson/data/assort.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "items": [ - { - "_name": "milk", - "_id": "6751d7d0ac6207409b0823a0", - "_tpl": "575146b724597720a27126d5", - "parentId": "hideout", - "slotId": "hideout", - "upd": { - "UnlimitedCount": false, - "StackObjectsCount": 200, - "BuyRestrictionMax": 10, - "BuyRestrictionCurrent": 0 - } - }, - { - "_name": "milk barter", - "_id": "6751d7d0ac6207409b0823a1", - "_tpl": "575146b724597720a27126d5", - "parentId": "hideout", - "slotId": "hideout", - "upd": { - "UnlimitedCount": false, - "StackObjectsCount": 200, - "BuyRestrictionMax": 10, - "BuyRestrictionCurrent": 0 - } - }, - { - "_name": "helmet", - "_id": "6751d7d0ac6207409b0823a2", - "_tpl": "5b40e3f35acfc40016388218", - "parentId": "hideout", - "slotId": "hideout", - "upd": { - "UnlimitedCount": false, - "StackObjectsCount": 200, - "BuyRestrictionMax": 10, - "BuyRestrictionCurrent": 0 - } - }, - { - "_name": "HELMET_SOFT_ARMOUR_TOP", - "_id": "6751d7d0ac6207409b0823a3", - "_tpl": "657f95bff92cd718b701550c", - "parentId": "HELMET_ID", - "slotId": "Helmet_top" - }, - { - "_name": "HELMET_SOFT_ARMOUR_BACK_ID", - "_id": "6751d7d0ac6207409b0823a4", - "_tpl": "657f9605f4c82973640b2358", - "parentId": "HELMET_ID", - "slotId": "Helmet_back" - }, - { - "_name": "HELMET_ID_BARTER", - "_id": "6751d7d0ac6207409b0823a5", - "_tpl": "5b40e3f35acfc40016388218", - "parentId": "hideout", - "slotId": "hideout", - "upd": { - "UnlimitedCount": false, - "StackObjectsCount": 200, - "BuyRestrictionMax": 10, - "BuyRestrictionCurrent": 0 - } - }, - { - "_name": "HELMET_SOFT_ARMOUR_TOP_ID_BARTER", - "_id": "6751d7d0ac6207409b0823a5", - "_tpl": "657f95bff92cd718b701550c", - "parentId": "HELMET_ID_BARTER", - "slotId": "Helmet_top" - }, - { - "_name": "HELMET_SOFT_ARMOUR_BACK_ID_BARTER", - "_id": "6751d7d0ac6207409b0823a6", - "_tpl": "657f9605f4c82973640b2358", - "parentId": "HELMET_ID_BARTER", - "slotId": "Helmet_back" - } - ], - "barter_scheme": { - "6751d7d0ac6207409b0823a0": [ - [ - { - "count": 2000, - "_tpl": "5449016a4bdc2d6f028b456f" - } - ] - ], - "6751d7d0ac6207409b0823a1": [ - [ - { - "count": 3, - "_tpl": "59faff1d86f7746c51718c9c" - }, - { - "count": 1, - "_tpl": "544fb45d4bdc2dee738b4568" - } - ] - ], - "6751d7d0ac6207409b0823a2": [ - [ - { - "count": 2000, - "_tpl": "5449016a4bdc2d6f028b456f" - } - ] - ], - "6751d7d0ac6207409b0823a5": [ - [ - { - "count": 3, - "_tpl": "59faff1d86f7746c51718c9c" - }, - { - "count": 1, - "_tpl": "544fb45d4bdc2dee738b4568" - } - ] - ] - }, - "loyal_level_items": { - "6751d7d0ac6207409b0823a0": 1, - "6751d7d0ac6207409b0823a1": 1, - "6751d7d0ac6207409b0823a2": 1, - "6751d7d0ac6207409b0823a5": 1 - } -} diff --git a/ModExamples/13AddTraderWithAssortJson/package.json b/ModExamples/13AddTraderWithAssortJson/package.json deleted file mode 100644 index 0d56d2d1..00000000 --- a/ModExamples/13AddTraderWithAssortJson/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "1313AddTraderWithAssortJson", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/14AfterDBLoadHook/14AfterDBLoadHook.csproj b/ModExamples/14AfterDBLoadHook/14AfterDBLoadHook.csproj deleted file mode 100644 index b602c5f7..00000000 --- a/ModExamples/14AfterDBLoadHook/14AfterDBLoadHook.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _14AfterDBLoadHook - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/14AfterDBLoadHook/AfterDBLoadHook.cs b/ModExamples/14AfterDBLoadHook/AfterDBLoadHook.cs deleted file mode 100644 index dfaee67d..00000000 --- a/ModExamples/14AfterDBLoadHook/AfterDBLoadHook.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Core.Models.Eft.Common.Tables; -using Core.Models.External; -using Core.Models.Logging; -using Core.Models.Utils; -using Core.Servers; -using SptCommon.Annotations; - -namespace _14AfterDBLoadHook; - -[Injectable(InjectableTypeOverride = typeof(IPostDBLoadMod))] -[Injectable(InjectableTypeOverride = typeof(IPostSptLoadMod))] -public class AfterDBLoadHook : IPostDBLoadMod, IPostSptLoadMod -{ - private readonly ConfigServer _configServer; - private readonly DatabaseServer _databaseServer; - private readonly ISptLogger _logger; - private Dictionary? _itemsDb; - - public AfterDBLoadHook( - ConfigServer configServer, - DatabaseServer databaseServer, - ISptLogger logger - ) - { - _configServer = configServer; - _databaseServer = databaseServer; - _logger = logger; - } - - public void PostDBLoad() - { - _itemsDb = _databaseServer.GetTables().Templates.Items; - - // Database will be loaded, this is the fresh state of the DB so NOTHING from the SPT - // logic has modified anything yet. This is the DB loaded straight from the JSON files - _logger.LogWithColor($"Database item size: {_itemsDb.Count}", LogTextColor.Red, LogBackgroundColor.Yellow); - - // lets do a quick modification and see how this reflect later on, on the postSptLoad() - // find the nvgs item by its Id - // this also checks if the item exists before giving you the item - // if it doesn't, this if check will fail - if (_itemsDb.TryGetValue("5c0558060db834001b735271", out var nvgs)) - { - // Lets log the state before the modification - _logger.LogWithColor($"NVGs default CanSellOnRagfair: {nvgs.Properties.CanSellOnRagfair}", LogTextColor.Red, LogBackgroundColor.Yellow); - // Update one of its properties to be true - nvgs.Properties.CanSellOnRagfair = true; - } - } - - public void PostSptLoad() - { - // The modification we made above would have been processed by now by SPT, so any values we changed had - // already been passed through the initial lifecycles (OnLoad) of SPT. - - if (_itemsDb.TryGetValue("5c0558060db834001b735271", out var nvgs)) - { - // Lets log the state after the modification - _logger.LogWithColor($"NVGs default CanSellOnRagfair: {nvgs.Properties.CanSellOnRagfair}", LogTextColor.Red, LogBackgroundColor.Yellow); - } - } -} diff --git a/ModExamples/14AfterDBLoadHook/package.json b/ModExamples/14AfterDBLoadHook/package.json deleted file mode 100644 index 3d21524e..00000000 --- a/ModExamples/14AfterDBLoadHook/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "14AfterDBLoadHook", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/15HttpListenerExample/15HttpListenerExample.csproj b/ModExamples/15HttpListenerExample/15HttpListenerExample.csproj deleted file mode 100644 index 1056aeb5..00000000 --- a/ModExamples/15HttpListenerExample/15HttpListenerExample.csproj +++ /dev/null @@ -1,39 +0,0 @@ - - - - net9.0 - _15HttpListenerExample - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - - - - diff --git a/ModExamples/15HttpListenerExample/HttpListenerExample.cs b/ModExamples/15HttpListenerExample/HttpListenerExample.cs deleted file mode 100644 index 47cd9ee0..00000000 --- a/ModExamples/15HttpListenerExample/HttpListenerExample.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Text; -using Core.Servers.Http; -using SptCommon.Annotations; - -namespace _15HttpListenerExample; - -[Injectable] -public class HttpListenerExample : IHttpListener -{ - public bool CanHandle(string sessionId, HttpRequest req) - { - return req.Method == "GET" && req.Method.Contains("/type-custom-url"); - } - - public void Handle(string sessionId, HttpRequest req, HttpResponse resp) - { - resp.StatusCode = 200; - resp.Body.WriteAsync(Encoding.UTF8.GetBytes("[1] This is the first example of a mod hooking into the HttpServer")).AsTask().Wait(); - resp.StartAsync().Wait(); - resp.CompleteAsync().Wait(); - } -} diff --git a/ModExamples/15HttpListenerExample/package.json b/ModExamples/15HttpListenerExample/package.json deleted file mode 100644 index 63c79d21..00000000 --- a/ModExamples/15HttpListenerExample/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "15HttpListenerExample", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/18.1CustomItemServiceLootBox/18.1CustomItemServiceLootBox.csproj b/ModExamples/18.1CustomItemServiceLootBox/18.1CustomItemServiceLootBox.csproj deleted file mode 100644 index c4560371..00000000 --- a/ModExamples/18.1CustomItemServiceLootBox/18.1CustomItemServiceLootBox.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _18._1CustomItemServiceLootBox - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/18.1CustomItemServiceLootBox/CustomItemServiceLootBox.cs b/ModExamples/18.1CustomItemServiceLootBox/CustomItemServiceLootBox.cs deleted file mode 100644 index 17f04e36..00000000 --- a/ModExamples/18.1CustomItemServiceLootBox/CustomItemServiceLootBox.cs +++ /dev/null @@ -1,117 +0,0 @@ -using Core.Models.Eft.Common.Tables; -using Core.Models.External; -using Core.Models.Spt.Config; -using Core.Models.Spt.Mod; -using Core.Models.Utils; -using Core.Servers; -using Core.Services.Mod; -using SptCommon.Annotations; - -namespace _18._1CustomItemServiceLootBox; - -[Injectable] -public class CustomItemServiceLootBox : IPostDBLoadMod, IPostSptLoadMod -{ - private CustomItemService _customItemService; - private DatabaseServer _databaseServer; - private ConfigServer _configServer; - private readonly ISptLogger _logger; - private Dictionary _itemDb; - - private InventoryConfig _inventoryConfig; - - public CustomItemServiceLootBox( - DatabaseServer databaseServer, - ConfigServer configServer, - ISptLogger logger, - CustomItemService customItemService - ) - { - _databaseServer = databaseServer; - _configServer = configServer; - _logger = logger; - _customItemService = customItemService; - - _inventoryConfig = _configServer.GetConfig(); - } - - public void PostDBLoad() - { - _itemDb = _databaseServer.GetTables().Templates.Items; - - // Example of adding new item by cloning existing item using createclonedetails - var crateId = "new_crate_with_randomized_content"; - var exampleCloneItem = new NewItemFromCloneDetails - { - // The item we want to clone, in this example i will cloning the sealed weapon crate - ItemTplToClone = "6489b2b131a2135f0d7d0fcb", - // ParentId refers to the Node item the container will be under, you can check it in https://db.sp-tarkov.com/search - ParentId = "62f109593b54472778797866", - // The new id of our cloned item - NewId = crateId, - FleaPriceRoubles = 50000, - HandbookPriceRoubles = 42500, - // Handbook Parent Id refers to the category the container will be under - // Handbook parent can be found in SPT_Data\Server\database\templates. - HandbookParentId = "62f109593b54472778797866", - Locales = new Dictionary - { - {"en", new LocaleDetails - { - Name = "Custom Lootbox", - ShortName = "Custom Lootbox", - Description = "A custom lootbox container" - } - } - }, - OverrideProperties = new Props - { - Name = "Custom Lootbox", - ShortName = "Custom Lootbox", - Description = "A custom lootbox container", - Weight = 15 - }, - }; - - // Basically calls the function and tell the server to add our Cloned new item into the server - _customItemService.CreateItemFromClone(exampleCloneItem); - - // Change item _name to remove it from the *actual* sealed weapon crate logic, this removes it from airdrops and allows easier access to change the contents - - var customItemInDb = _itemDb.GetValueOrDefault(crateId); - customItemInDb.Name = crateId; - - // Add to inventory config with custom item pool - _inventoryConfig.RandomLootContainers[crateId] = new RewardDetails - { - RewardCount = 6, - FoundInRaid = true, - RewardTplPool = new Dictionary - { - {"57514643245977207f2c2d09", 1}, - {"544fb62a4bdc2dfb738b4568", 1}, - {"57513f07245977207e26a311", 1}, - {"57513f9324597720a7128161", 1}, - {"57513fcc24597720a31c09a6", 1}, - {"5e8f3423fd7471236e6e3b64", 1}, - {"60b0f93284c20f0feb453da7", 1}, - {"5734773724597737fd047c14", 1}, - {"59e3577886f774176a362503", 1}, - {"57505f6224597709a92585a9", 1}, - {"544fb6cc4bdc2d34748b456e", 1} - } - }; - } - - // Check if our item is in the server or not - public void PostSptLoad() - { - if (_itemDb.TryGetValue("new_crate_with_randomized_content", out var crate)) - { - _logger.LogWithColor("Item Exists in DB"); - return; - } - - _logger.LogWithColor("Item Doesn't Exist in DB"); - } -} diff --git a/ModExamples/18.1CustomItemServiceLootBox/package.json b/ModExamples/18.1CustomItemServiceLootBox/package.json deleted file mode 100644 index 7c475e6d..00000000 --- a/ModExamples/18.1CustomItemServiceLootBox/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "18.1CustomItemServiceLootBox", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/18CustomItemService/18CustomItemService.csproj b/ModExamples/18CustomItemService/18CustomItemService.csproj deleted file mode 100644 index c4690290..00000000 --- a/ModExamples/18CustomItemService/18CustomItemService.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _18CustomItemService - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/18CustomItemService/CustomItemServiceExample.cs b/ModExamples/18CustomItemService/CustomItemServiceExample.cs deleted file mode 100644 index b52ce5d8..00000000 --- a/ModExamples/18CustomItemService/CustomItemServiceExample.cs +++ /dev/null @@ -1,119 +0,0 @@ -using Core.Models.Eft.Common.Tables; -using Core.Models.External; -using Core.Models.Logging; -using Core.Models.Spt.Mod; -using Core.Models.Utils; -using Core.Servers; -using Core.Services.Mod; -using SptCommon.Annotations; - -namespace _18CustomItemService; - -[Injectable] -public class CustomItemServiceExample : IPostDBLoadMod, IPostSptLoadMod -{ - private readonly CustomItemService _customItemService; - private readonly ISptLogger _logger; - private readonly DatabaseServer _databaseServer; - - public CustomItemServiceExample( - CustomItemService customItemService, - ISptLogger logger, - DatabaseServer databaseServer - ) - { - _customItemService = customItemService; - _logger = logger; - _databaseServer = databaseServer; - } - - public void PostDBLoad() - { - //Example of adding new item by cloning an existing item using `createCloneDetails` - var exampleCloneItem = new NewItemFromCloneDetails - { - ItemTplToClone = ItemTpl.SHOTGUN_MP18_762X54R_SINGLESHOT_RIFLE, - // ParentId refers to the Node item the gun will be under, you can check it in https://db.sp-tarkov.com/search - ParentId = "5447b6094bdc2dc3278b4567", - // The new id of our cloned item - MUST be a valid mongo id, search online for mongo id generators - NewId = "677eed5f2e040616bc7246b6", - // Flea price of item - FleaPriceRoubles = 50000, - // Price of item in handbook - HandbookPriceRoubles = 42500, - // Handbook Parent Id refers to the category the gun will be under - HandbookParentId = "5b5f78e986f77447ed5636b1", - //you see those side box tab thing that only select gun under specific icon? Handbook parent can be found in Spt_Data\Server\database\templates. - Locales = new Dictionary - { - { - "en", new LocaleDetails - { - Name = "MP-18 12g", - ShortName = "Custom MP18", - Description = "A custom MP18 chambered in 12G" - } - } - }, - OverrideProperties = new Props - { - Chambers = - [ - new Slot - { - Name = "patron_in_weapon_000", - Id = "61f7c9e189e6fb1a5e3ea791", - Parent = "CustomMP18", - Props = new SlotProps - { - Filters = - [ - new SlotFilter - { - Filter = - [ - "560d5e524bdc2d25448b4571", - "5d6e6772a4b936088465b17c", - "5d6e67fba4b9361bc73bc779", - "5d6e6806a4b936088465b17e", - "5d6e68dea4b9361bcc29e659", - "5d6e6911a4b9361bd5780d52", - "5c0d591486f7744c505b416f", - "58820d1224597753c90aeb13", - "5d6e68c4a4b9361b93413f79", - "5d6e68a8a4b9360b6c0d54e2", - "5d6e68e6a4b9361c140bcfe0", - "5d6e6869a4b9361c140bcfde", - "5d6e68b3a4b9361bca7e50b5", - "5d6e6891a4b9361bd473feea", - "5d6e689ca4b9361bc8618956", - "5d6e68d1a4b93622fe60e845" - ] - } - ] - }, - Required = false, - MergeSlotWithChildren = false, - Proto = "55d4af244bdc2d962f8b4571" - } - ] - }, - }; - - _customItemService.CreateItemFromClone(exampleCloneItem); // Send our data to the function that creates our item - } - - // Optional - check if our item is in the server or not - public void PostSptLoad() - { - var items = _databaseServer.GetTables().Templates.Items; - - if (items.TryGetValue("677eed5f2e040616bc7246b6", out var item)) - { - _logger.LogWithColor("Item exists in DB", LogTextColor.Red, LogBackgroundColor.Yellow); - return; - } - - _logger.LogWithColor("Item was not found in DB", LogTextColor.Red, LogBackgroundColor.Yellow); - } -} diff --git a/ModExamples/18CustomItemService/package.json b/ModExamples/18CustomItemService/package.json deleted file mode 100644 index c539bb7e..00000000 --- a/ModExamples/18CustomItemService/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "18CustomItemService", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/1Logging/1Logging.csproj b/ModExamples/1Logging/1Logging.csproj deleted file mode 100644 index fa5bd113..00000000 --- a/ModExamples/1Logging/1Logging.csproj +++ /dev/null @@ -1,37 +0,0 @@ - - - - net9.0 - _1Logging - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - - diff --git a/ModExamples/1Logging/Logging.cs b/ModExamples/1Logging/Logging.cs deleted file mode 100644 index ed8e0e4e..00000000 --- a/ModExamples/1Logging/Logging.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Core.Models.External; -using Core.Models.Logging; -using Core.Models.Utils; -using SptCommon.Annotations; - -namespace _1Logging; - -[Injectable] -public class Logging : IPostSptLoadMod // Using this interface means our mod will run AFTER SPT has finished loading -{ - // Our logger we create in the constructor below - private readonly ISptLogger _logger; - - // Constructor - Inject a 'ISptLogger' with your mods Class inside 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; - } - - public void PostSptLoad() - { - // 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/ModExamples/1Logging/package.json b/ModExamples/1Logging/package.json deleted file mode 100644 index bb8023fe..00000000 --- a/ModExamples/1Logging/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "1Logging", - "author": "SPT", - "contributors": [], - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "incompatibilities": [], - "dependencies": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "licence": "MIT" -} diff --git a/ModExamples/20CustomChatBot/20CustomChatBot.csproj b/ModExamples/20CustomChatBot/20CustomChatBot.csproj deleted file mode 100644 index 9aba3cca..00000000 --- a/ModExamples/20CustomChatBot/20CustomChatBot.csproj +++ /dev/null @@ -1,37 +0,0 @@ - - - - net9.0 - _20CustomChatBot - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - - diff --git a/ModExamples/20CustomChatBot/CustomChatBot.cs b/ModExamples/20CustomChatBot/CustomChatBot.cs deleted file mode 100644 index 555d9388..00000000 --- a/ModExamples/20CustomChatBot/CustomChatBot.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Core.Helpers.Dialogue; -using Core.Models.Eft.Dialog; -using Core.Models.Eft.Profile; -using Core.Models.Enums; -using Core.Services; -using SptCommon.Annotations; - -namespace _20CustomChatBot; - -[Injectable] -public class CustomChatBot : IDialogueChatBot -{ - private MailSendService _mailSendService; - - public CustomChatBot( - MailSendService mailSendService - ) - { - _mailSendService = mailSendService; - } - - public UserDialogInfo GetChatBot() - { - return new UserDialogInfo - { - Id = "modderBuddy", - Aid = 9999999, - Info = new UserDialogDetails - { - Nickname = "Buddy", - Side = "Usec", - Level = 69, - MemberCategory = MemberCategory.Sherpa, - SelectedMemberCategory = MemberCategory.Sherpa - } - }; - } - - public string? HandleMessage(string sessionId, SendMessageRequest request) - { - _mailSendService.SendUserMessageToPlayer( - sessionId, - GetChatBot(), - $"Im Buddy! I just reply back what you typed to me!\n{request.Text}"); - - return request.DialogId; - } -} diff --git a/ModExamples/20CustomChatBot/package.json b/ModExamples/20CustomChatBot/package.json deleted file mode 100644 index f76d93f5..00000000 --- a/ModExamples/20CustomChatBot/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "20CustomChatBot", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/21CustomCommandoCommand/21CustomCommandoCommand.csproj b/ModExamples/21CustomCommandoCommand/21CustomCommandoCommand.csproj deleted file mode 100644 index 41617de7..00000000 --- a/ModExamples/21CustomCommandoCommand/21CustomCommandoCommand.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _21CustomCommandoCommand - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/21CustomCommandoCommand/CustomCommandoCommand.cs b/ModExamples/21CustomCommandoCommand/CustomCommandoCommand.cs deleted file mode 100644 index f43a1ade..00000000 --- a/ModExamples/21CustomCommandoCommand/CustomCommandoCommand.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Core.Helpers.Dialog.Commando; -using Core.Models.Eft.Dialog; -using Core.Models.Eft.Profile; -using Core.Servers; -using Core.Services; -using SptCommon.Annotations; - -namespace _21CustomCommandoCommand; - -[Injectable] -public class CustomCommandoCommand : IChatCommand -{ - private DatabaseServer _databaseServer; - private MailSendService _mailSendService; - - public CustomCommandoCommand( - DatabaseServer databaseServer, - MailSendService mailSendService - ) - { - _databaseServer = databaseServer; - _mailSendService = mailSendService; - } - - public string GetCommandPrefix() - { - return "test"; - } - - public string? GetCommandHelp(string command) - { - if (command == "talk") - { - return "Usage: test talk"; - } - - return null; - } - - public List GetCommands() - { - return ["talk"]; - } - - // spelling of sessionId is fixed in server - public string? Handle(string command, UserDialogInfo commandHandler, string sessionId, SendMessageRequest request) - { - if (command == "talk") - { - _mailSendService.SendUserMessageToPlayer(sessionId, commandHandler, $"IM TALKING! OKAY?!\nHere's the walk speed X config from the DB: {_databaseServer.GetTables().Globals.Configuration.WalkSpeed.X}"); - return request.DialogId; - } - - return null; - } -} diff --git a/ModExamples/21CustomCommandoCommand/package.json b/ModExamples/21CustomCommandoCommand/package.json deleted file mode 100644 index 45dbe823..00000000 --- a/ModExamples/21CustomCommandoCommand/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "21CustomCommandoCommand", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/22CustomSptCommand/22CustomSptCommand.csproj b/ModExamples/22CustomSptCommand/22CustomSptCommand.csproj deleted file mode 100644 index aad8205b..00000000 --- a/ModExamples/22CustomSptCommand/22CustomSptCommand.csproj +++ /dev/null @@ -1,43 +0,0 @@ - - - - net9.0 - _22CustomSptCommand - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - - - true - PreserveNewest - PreserveNewest - - - diff --git a/ModExamples/22CustomSptCommand/CustomSptCommand.cs b/ModExamples/22CustomSptCommand/CustomSptCommand.cs deleted file mode 100644 index df28eb97..00000000 --- a/ModExamples/22CustomSptCommand/CustomSptCommand.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Core.Helpers; -using Core.Helpers.Dialog.Commando.SptCommands; -using Core.Models.Eft.Dialog; -using Core.Models.Eft.Profile; -using Core.Services; -using SptCommon.Annotations; - -namespace _22CustomSptCommand; - -[Injectable] -public class CustomSptCommand : ISptCommand -{ - private readonly MailSendService _mailSendService; - private readonly ItemHelper _itemHelper; - - public CustomSptCommand( - MailSendService mailSendService, - ItemHelper itemHelper - ) - { - _mailSendService = mailSendService; - _itemHelper = itemHelper; - } - - public string GetCommand() - { - return "getName"; - } - - public string GetCommandHelp() - { - return "Usage: spt getName tplId"; - } - - public string PerformAction(UserDialogInfo commandHandler, string sessionId, SendMessageRequest request) - { - var splitCommand = request.Text.Split(" "); - _mailSendService.SendUserMessageToPlayer(sessionId, commandHandler, $"That templateId belongs to item {_itemHelper.GetItem(splitCommand[2]).Value?.Properties?.Name ?? ""}"); - return request.DialogId; - } -} diff --git a/ModExamples/22CustomSptCommand/package.json b/ModExamples/22CustomSptCommand/package.json deleted file mode 100644 index 2469dae6..00000000 --- a/ModExamples/22CustomSptCommand/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "22CustomSptCommand", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/23CustomAbstractChatBot/23CustomAbstractChatBot.csproj b/ModExamples/23CustomAbstractChatBot/23CustomAbstractChatBot.csproj deleted file mode 100644 index fd6224fb..00000000 --- a/ModExamples/23CustomAbstractChatBot/23CustomAbstractChatBot.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - net9.0 - _23CustomAbstractChatBot - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - - - true - PreserveNewest - PreserveNewest - - - - diff --git a/ModExamples/23CustomAbstractChatBot/Commands/AnotherCoolCommand.cs b/ModExamples/23CustomAbstractChatBot/Commands/AnotherCoolCommand.cs deleted file mode 100644 index 13e9935d..00000000 --- a/ModExamples/23CustomAbstractChatBot/Commands/AnotherCoolCommand.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Core.Helpers.Dialog.Commando; -using Core.Models.Eft.Dialog; -using Core.Models.Eft.Profile; -using Core.Services; - -namespace _23CustomAbstractChatBot.Commands; - -public class AnotherCoolCommand : IChatCommand -{ - private readonly MailSendService _mailSendService; - - public AnotherCoolCommand( - MailSendService mailSendService - ) - { - _mailSendService = mailSendService; - } - - public string GetCommandPrefix() - { - return "anotherExample"; - } - - public string? GetCommandHelp(string command) - { - if (command == "test") - { - return "Usage: anotherExample test"; - } - - return null; - } - - public List GetCommands() - { - return ["test"]; - } - - public string? Handle(string command, UserDialogInfo commandHandler, string sessionId, SendMessageRequest request) - { - if (command == "test") - { - _mailSendService.SendUserMessageToPlayer(sessionId, commandHandler, $"This is another test message shown as a different example!"); - return request.DialogId; - } - - return null; - } -} diff --git a/ModExamples/23CustomAbstractChatBot/Commands/MyCoolCommand.cs b/ModExamples/23CustomAbstractChatBot/Commands/MyCoolCommand.cs deleted file mode 100644 index a87522b7..00000000 --- a/ModExamples/23CustomAbstractChatBot/Commands/MyCoolCommand.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Core.Helpers.Dialog.Commando; -using Core.Models.Eft.Dialog; -using Core.Models.Eft.Profile; -using Core.Services; - -namespace _23CustomAbstractChatBot.Commands; - -public class MyCoolCommand : IChatCommand -{ - private readonly MailSendService _mailSendService; - - public MyCoolCommand( - MailSendService mailSendService - ) - { - _mailSendService = mailSendService; - } - - public string GetCommandPrefix() - { - return "example"; - } - - public string? GetCommandHelp(string command) - { - if (command == "test") - { - return "Usage: example test"; - } - - return null; - } - - public List GetCommands() - { - return ["test"]; - } - - public string? Handle(string command, UserDialogInfo commandHandler, string sessionId, SendMessageRequest request) - { - if (command == "test") - { - _mailSendService.SendUserMessageToPlayer(sessionId, commandHandler, $"This is a test message shown as an example!"); - return request.DialogId; - } - - return null; - } -} diff --git a/ModExamples/23CustomAbstractChatBot/CustomAbstractChatBot.cs b/ModExamples/23CustomAbstractChatBot/CustomAbstractChatBot.cs deleted file mode 100644 index db15b5b7..00000000 --- a/ModExamples/23CustomAbstractChatBot/CustomAbstractChatBot.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Core.Helpers.Dialog.Commando; -using Core.Helpers.Dialogue; -using Core.Helpers.Dialogue.SPTFriend.Commands; -using Core.Models.Eft.Profile; -using Core.Models.Enums; -using Core.Models.Utils; -using Core.Services; - -namespace _23CustomAbstractChatBot; - -public class CustomAbstractChatBot : AbstractDialogChatBot -{ - public CustomAbstractChatBot( - ISptLogger _logger, - MailSendService _mailSendService, - IEnumerable _chatCommands, - IEnumerable _chatMessageHandlers - ) : base(_logger, _mailSendService, _chatCommands) - { - } - - public override UserDialogInfo GetChatBot() - { - return new UserDialogInfo - { - Id = "674db14ed849a3727ef24da0", // REQUIRES a valid monogo_id, use online generator to create one - Aid = 1234566, - Info = new UserDialogDetails - { - Level = 69, - MemberCategory = MemberCategory.Developer, - SelectedMemberCategory = MemberCategory.Developer, - Nickname = "CoolAbstractChatBot", - Side = "Bear" - } - }; - } - - protected override string GetUnrecognizedCommandMessage() - { - return "No clue what you are talking about bud!"; - } -} diff --git a/ModExamples/23CustomAbstractChatBot/package.json b/ModExamples/23CustomAbstractChatBot/package.json deleted file mode 100644 index 28d95078..00000000 --- a/ModExamples/23CustomAbstractChatBot/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "23CustomAbstractChatBot", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/24Websocket/24Websocket.csproj b/ModExamples/24Websocket/24Websocket.csproj deleted file mode 100644 index b4eac324..00000000 --- a/ModExamples/24Websocket/24Websocket.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - net9.0 - _24Websocket - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - - - true - PreserveNewest - PreserveNewest - - - - diff --git a/ModExamples/24Websocket/WebsocketConnectionHandler.cs b/ModExamples/24Websocket/WebsocketConnectionHandler.cs deleted file mode 100644 index 1fc198ec..00000000 --- a/ModExamples/24Websocket/WebsocketConnectionHandler.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Net.WebSockets; -using System.Text; -using Core.Models.Utils; -using Core.Servers.Ws; -using SptCommon.Annotations; - -namespace _24Websocket; -[Injectable(InjectionType = InjectionType.Singleton)] -public class CustomWebSocketConnectionHandler: IWebSocketConnectionHandler -{ - private readonly ISptLogger _logger; - public CustomWebSocketConnectionHandler( - ISptLogger logger - ) - { - _logger = logger; - } - - public string GetHookUrl() - { - return "/custom/socket/"; - } - - public string GetSocketId() - { - return "My Custom WebSocket"; - } - - public Task OnConnection(WebSocket ws, HttpContext context) - { - _logger.Info("Custom web socket is now connected!"); - - return Task.CompletedTask; - } - - public Task OnMessage(byte[] rawData, WebSocketMessageType messageType, WebSocket ws, HttpContext context) - { - var msg = Encoding.UTF8.GetString(rawData); - - if (msg == "toodaloo") - { - return ws.SendAsync(Encoding.UTF8.GetBytes("toodaloo back!"), WebSocketMessageType.Text, true, CancellationToken.None); - } - - return Task.CompletedTask; - } - - public Task OnClose(WebSocket ws, HttpContext context) - { - return Task.CompletedTask; - } -} diff --git a/ModExamples/24Websocket/WebsocketMessageHandler.cs b/ModExamples/24Websocket/WebsocketMessageHandler.cs deleted file mode 100644 index 8b60d19e..00000000 --- a/ModExamples/24Websocket/WebsocketMessageHandler.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Net.WebSockets; -using Core.Models.Utils; -using Core.Servers.Ws.Message; - -namespace _24Websocket; - -public class WebsocketMessageHandler : ISptWebSocketMessageHandler -{ - private readonly ISptLogger _logger; - - public WebsocketMessageHandler( - ISptLogger logger - ) - { - _logger = logger; - } - - public Task OnSptMessage(string sessionID, WebSocket client, byte[] rawData) - { - _logger.Info($"Custom SPT WebSocket Message handler received a message for {sessionID}: {rawData.ToString()}"); - return Task.CompletedTask; - } -} diff --git a/ModExamples/24Websocket/package.json b/ModExamples/24Websocket/package.json deleted file mode 100644 index cd57a504..00000000 --- a/ModExamples/24Websocket/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "24Websocket", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/2EditDatabase/2EditDatabase.csproj b/ModExamples/2EditDatabase/2EditDatabase.csproj deleted file mode 100644 index e2167dd2..00000000 --- a/ModExamples/2EditDatabase/2EditDatabase.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _2EditDatabase - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/2EditDatabase/EditDatabaseValues.cs b/ModExamples/2EditDatabase/EditDatabaseValues.cs deleted file mode 100644 index aeffbecc..00000000 --- a/ModExamples/2EditDatabase/EditDatabaseValues.cs +++ /dev/null @@ -1,196 +0,0 @@ -using Core.Models.Enums; -using Core.Models.External; -using Core.Models.Utils; -using Core.Services; -using SptCommon.Annotations; - -namespace _2EditDatabase; - -[Injectable] -public class EditDatabaseValues : IPostDBLoadMod // Using this interface means our mod will run AFTER the SPT database has finished loading but BEFORE SPT code has run -{ - private readonly DatabaseService _databaseService; - private readonly ISptLogger _logger; - - // Our constructor - public EditDatabaseValues( - DatabaseService databaseService, - ISptLogger logger - ) - { - _databaseService = databaseService; - _logger = logger; - } - - public void PostDBLoad() - { - // 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 (assault.json) to have different settings - EditScavSettings(); - - // Lets edit Customs - EditCustoms(); - - _logger.Success("Finished Editing Database"); - } - - 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/ModExamples/2EditDatabase/package.json b/ModExamples/2EditDatabase/package.json deleted file mode 100644 index e448782b..00000000 --- a/ModExamples/2EditDatabase/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "2EditDatabase", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/3EditSptConfig/3EditSptConfig.csproj b/ModExamples/3EditSptConfig/3EditSptConfig.csproj deleted file mode 100644 index 38976710..00000000 --- a/ModExamples/3EditSptConfig/3EditSptConfig.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _3EditSptConfig - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/3EditSptConfig/EditConfigs.cs b/ModExamples/3EditSptConfig/EditConfigs.cs deleted file mode 100644 index 4b09834d..00000000 --- a/ModExamples/3EditSptConfig/EditConfigs.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Core.Models.Enums; -using Core.Models.External; -using Core.Models.Spt.Config; -using Core.Models.Utils; -using Core.Servers; -using SptCommon.Annotations; - -namespace _3EditSptConfig; - -[Injectable] -public class EditConfigs : IPostDBLoadMod -{ - private readonly AirdropConfig _airdropConfig; - private readonly BotConfig _botConfig; - private readonly ConfigServer _configServer; - private readonly HideoutConfig _hideoutConfig; - - private readonly ISptLogger _logger; - private readonly PmcChatResponse _pmcChatResponseConfig; - private readonly PmcConfig _pmcConfig; - private readonly QuestConfig _questConfig; - private readonly WeatherConfig _weatherConfig; - - // We access configs via ConfigServer - public EditConfigs( - ConfigServer configServer, - ISptLogger logger - ) - { - _configServer = configServer; - _logger = logger; - - // 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(); - } - - public void PostDBLoad() - { - // Let's edit the weather config to force the season to 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 for unheard profiles - _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"); - - _logger.Success("Finished Editing Configs"); - } -} diff --git a/ModExamples/3EditSptConfig/package.json b/ModExamples/3EditSptConfig/package.json deleted file mode 100644 index f355c9ac..00000000 --- a/ModExamples/3EditSptConfig/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "3EditSptConfig", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/4ReadCustomJson5Config/4ReadCustomJson5Config.csproj b/ModExamples/4ReadCustomJson5Config/4ReadCustomJson5Config.csproj deleted file mode 100644 index bdeaf779..00000000 --- a/ModExamples/4ReadCustomJson5Config/4ReadCustomJson5Config.csproj +++ /dev/null @@ -1,51 +0,0 @@ - - - - net9.0 - _4ReadCustomJson5Config - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - true - true - - - - - true - true - true - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - - - - Always - - - diff --git a/ModExamples/4ReadCustomJson5Config/ReadJson5Config.cs b/ModExamples/4ReadCustomJson5Config/ReadJson5Config.cs deleted file mode 100644 index b5523d5a..00000000 --- a/ModExamples/4ReadCustomJson5Config/ReadJson5Config.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Core.Helpers; -using System.Reflection; -using Core.Models.External; -using Core.Models.Utils; -using fastJSON5; -using SptCommon.Annotations; - -namespace _4ReadCustomJson5Config -{ - [Injectable] - public class ReadJson5Config: IPreSptLoadMod - { - private readonly ISptLogger _logger; - private readonly ModHelper _modHelper; - - public ReadJson5Config( - ISptLogger logger, - ModHelper modHelper) - { - _logger = logger; - _modHelper = modHelper; - } - - public void PreSptLoad() - { - var pathToMod = _modHelper.GetAbsolutePathToModFolder(Assembly.GetExecutingAssembly()); - - // To use JSON5, you will have to find and provide your own JSON5 library to decode it - var json5Config = JSON5.ToObject(_modHelper.GetRawFileData(pathToMod, "config.json5")); - - _logger.Success($"Read property: 'ExampleProperty' from config with value: {json5Config.ExampleProperty}"); - } - } - - // This class should represent your config structure - public class ModConfig - { - public string ExampleProperty { get; set; } - } -} diff --git a/ModExamples/4ReadCustomJson5Config/config.json5 b/ModExamples/4ReadCustomJson5Config/config.json5 deleted file mode 100644 index 008be89c..00000000 --- a/ModExamples/4ReadCustomJson5Config/config.json5 +++ /dev/null @@ -1,4 +0,0 @@ -{ - // Comment goes here, wow - "ExampleProperty": "boop" -} diff --git a/ModExamples/4ReadCustomJson5Config/package.json b/ModExamples/4ReadCustomJson5Config/package.json deleted file mode 100644 index 4277e6ef..00000000 --- a/ModExamples/4ReadCustomJson5Config/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "4ReadCustomJson5Config", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT", - "dependencies": [ - { - "name": "fastJSON5", - "version": "1.0.4" - } - ] -} diff --git a/ModExamples/5ReadCustomJsonConfig/5ReadCustomJsonConfig.csproj b/ModExamples/5ReadCustomJsonConfig/5ReadCustomJsonConfig.csproj deleted file mode 100644 index 1d15a3e5..00000000 --- a/ModExamples/5ReadCustomJsonConfig/5ReadCustomJsonConfig.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _5ReadCustomJsonConfig - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/5ReadCustomJsonConfig/ReadJsonConfig.cs b/ModExamples/5ReadCustomJsonConfig/ReadJsonConfig.cs deleted file mode 100644 index d10b4110..00000000 --- a/ModExamples/5ReadCustomJsonConfig/ReadJsonConfig.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Reflection; -using Core.Helpers; -using Core.Models.External; -using Core.Models.Utils; -using Core.Utils; -using SptCommon.Annotations; - -namespace _5ReadCustomJsonConfig -{ - [Injectable] - public class ReadJsonConfig : IPreSptLoadMod - { - private readonly ISptLogger _logger; - private readonly ModHelper _modHelper; - - public ReadJsonConfig( - ISptLogger logger, - ModHelper modHelper) - { - _logger = logger; - _modHelper = modHelper; - } - - public void PreSptLoad() - { - // This will get us the full path to the mod, e.g. C:\spt\user\mods\5ReadCustomJsonConfig-0.0.1 - var pathToMod = _modHelper.GetAbsolutePathToModFolder(Assembly.GetExecutingAssembly()); - - // We give the path to the mod folder and the file we want to get, giving us the config, supply the files 'type' between the diamond brackets - var config = _modHelper.GetJsonDataFromFile(pathToMod, "config.json"); - - _logger.Success($"Read property: 'ExampleProperty' from config with value: {config.ExampleProperty}"); - } - } - - // This class should represent your config structure - public class ModConfig - { - public string ExampleProperty - { - get; set; - } - } -} diff --git a/ModExamples/5ReadCustomJsonConfig/config.json b/ModExamples/5ReadCustomJsonConfig/config.json deleted file mode 100644 index 907dc42a..00000000 --- a/ModExamples/5ReadCustomJsonConfig/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ExampleProperty": "boop" -} diff --git a/ModExamples/5ReadCustomJsonConfig/package.json b/ModExamples/5ReadCustomJsonConfig/package.json deleted file mode 100644 index 7e825910..00000000 --- a/ModExamples/5ReadCustomJsonConfig/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "5ReadCustomConfig", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/6OverrideMethod/6OverrideMethod.csproj b/ModExamples/6OverrideMethod/6OverrideMethod.csproj deleted file mode 100644 index bde59eda..00000000 --- a/ModExamples/6OverrideMethod/6OverrideMethod.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _6OverrideMethod - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/6OverrideMethod/OverrideMethod.cs b/ModExamples/6OverrideMethod/OverrideMethod.cs deleted file mode 100644 index 70244895..00000000 --- a/ModExamples/6OverrideMethod/OverrideMethod.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Core.Models.Utils; -using Core.Servers; -using Core.Services; -using Core.Utils; -using SptCommon.Annotations; - -namespace _6OverrideMethod -{ - [Injectable(InjectableTypeOverride = typeof(Watermark))] - public class OverrideMethod: Watermark - { - public OverrideMethod( - ISptLogger logger, // The logger needs to use the same type as the overriden type (in this case, Watermark) - ConfigServer configServer, - LocalisationService localisationService, - WatermarkLocale watermarkLocale) - : base(logger, configServer, localisationService, watermarkLocale) // You must provide the parameters the overridden type requires - { } - - public override void Initialize() - { - // We add a log message to the init method - _logger.Success("This is a watermark mod override!"); - - // This runs the original method (optional) - base.Initialize(); - } - } -} diff --git a/ModExamples/6OverrideMethod/package.json b/ModExamples/6OverrideMethod/package.json deleted file mode 100644 index 64086d4d..00000000 --- a/ModExamples/6OverrideMethod/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "6OverrideMethod", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/7UseMultipleClasses/7UseMultipleClasses.csproj b/ModExamples/7UseMultipleClasses/7UseMultipleClasses.csproj deleted file mode 100644 index 4d345be8..00000000 --- a/ModExamples/7UseMultipleClasses/7UseMultipleClasses.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _7UseMultipleClasses - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/7UseMultipleClasses/SecondClass.cs b/ModExamples/7UseMultipleClasses/SecondClass.cs deleted file mode 100644 index 4cdbb5cb..00000000 --- a/ModExamples/7UseMultipleClasses/SecondClass.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace _7UseMultipleClasses -{ - public class SecondClass - { - public string GetText() - { - return "test text"; - } - } -} diff --git a/ModExamples/7UseMultipleClasses/UseMultipleClasses.cs b/ModExamples/7UseMultipleClasses/UseMultipleClasses.cs deleted file mode 100644 index cf45dbdb..00000000 --- a/ModExamples/7UseMultipleClasses/UseMultipleClasses.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Core.Models.External; -using Core.Models.Utils; - -namespace _7UseMultipleClasses -{ - /// - /// Having multiple classes can make keeping your code maintainable easier, you can split related code into their own class - /// - public class UseMultipleClasses : IPostDBLoadMod - { - private readonly ISptLogger _logger; - - public UseMultipleClasses( - ISptLogger logger) - { - this._logger = logger; - } - - public void PostDBLoad() - { - // We create an instance of the other class - var otherClass = new SecondClass(); - - // We call the "GetText" method that exists in the other class - var text = otherClass.GetText(); - - // Log the result to the server console - _logger.Info($"The SecondClass returned the text: {text}"); - } - } -} diff --git a/ModExamples/7UseMultipleClasses/package.json b/ModExamples/7UseMultipleClasses/package.json deleted file mode 100644 index 70924f53..00000000 --- a/ModExamples/7UseMultipleClasses/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "7UseMultipleClasses", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/8OnLoad/8OnLoad.csproj b/ModExamples/8OnLoad/8OnLoad.csproj deleted file mode 100644 index 5130c88c..00000000 --- a/ModExamples/8OnLoad/8OnLoad.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _8OnLoad - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/8OnLoad/OnLoadExample.cs b/ModExamples/8OnLoad/OnLoadExample.cs deleted file mode 100644 index ac308741..00000000 --- a/ModExamples/8OnLoad/OnLoadExample.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Core.DI; -using Core.Models.Utils; -using SptCommon.Annotations; - -namespace _8OnLoad -{ - // Flag class as being OnLoad and give it a load priority, check `OnLoadOrder` for list of possible choices - [Injectable(InjectableTypeOverride = typeof(IOnLoad), TypePriority = OnLoadOrder.PostSptDatabase)] // Can also give an int value for fine-grained control - [Injectable(InjectableTypeOverride = typeof(OnLoadExample))] - public class OnLoadExample : IOnLoad // Must implement the IOnLoad interface - { - private readonly ISptLogger _logger; - - public OnLoadExample( - ISptLogger logger) - { - _logger = logger; - } - - public Task OnLoad() - { - // Can do work here - _logger.Success($"Mod loaded after database!"); - - return Task.CompletedTask; - } - - public string GetRoute() - { - return "mod-load-example"; - } - } -} diff --git a/ModExamples/8OnLoad/package.json b/ModExamples/8OnLoad/package.json deleted file mode 100644 index f7a96e21..00000000 --- a/ModExamples/8OnLoad/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "8OnLoadExample", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/9OnUpdate/9OnUpdate.csproj b/ModExamples/9OnUpdate/9OnUpdate.csproj deleted file mode 100644 index f212db45..00000000 --- a/ModExamples/9OnUpdate/9OnUpdate.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net9.0 - _9OnUpdate - enable - enable - Library - 0.0.1 - - bin\$(Configuration)\$(ProjectName)\$(AssemblyName)-$(Version)\ - false - - - - - - ..\TempReferences\Core.dll - false - false - false - - - ..\TempReferences\SptCommon.dll - false - false - false - - - ..\TempReferences\SptDependencyInjection.dll - false - false - false - - - diff --git a/ModExamples/9OnUpdate/OnUpdateExample.cs b/ModExamples/9OnUpdate/OnUpdateExample.cs deleted file mode 100644 index 65ca3ed1..00000000 --- a/ModExamples/9OnUpdate/OnUpdateExample.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Core.DI; -using Core.Models.Utils; -using SptCommon.Annotations; - -namespace _9OnUpdate -{ - // Flag class as being OnLoad and give it a load priority, check `OnLoadOrder` for list of possible choices - [Injectable(InjectableTypeOverride = typeof(IOnUpdate), TypePriority = OnUpdateOrder.PostSptUpdate)] // Can also give it an int value for more fine-grained control - [Injectable(InjectableTypeOverride = typeof(OnUpdateExample))] - public class OnUpdateExample : IOnUpdate // Must implement the IOnUpdate interface - { - private readonly ISptLogger _logger; - - public OnUpdateExample( - ISptLogger logger) - { - _logger = logger; - } - - public bool OnUpdate(long timeSinceLastRun) - { - // Can do work here - _logger.Success($"Mod running update after SPT updates have run!"); - - return true; // Return true for a success, false for failure - } - - public string GetRoute() - { - return "mod-update-example"; - } - } -} diff --git a/ModExamples/9OnUpdate/package.json b/ModExamples/9OnUpdate/package.json deleted file mode 100644 index 2b7afe81..00000000 --- a/ModExamples/9OnUpdate/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "9OnUpdateExample", - "version": "1.0.0", - "sptVersion": "~4.0", - "loadBefore": [], - "loadAfter": [], - "IncompatibileMods": [], - "url": "https://github.com/sp-tarkov/server-csharp/tree/develop/ExampleMods/Mods", - "isBundleMod": false, - "author": "SPT", - "contributors": [], - "licence": "MIT" -} diff --git a/ModExamples/ModExamples.sln b/ModExamples/ModExamples.sln deleted file mode 100644 index 430fa4dc..00000000 --- a/ModExamples/ModExamples.sln +++ /dev/null @@ -1,154 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.12.35527.113 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "1Logging", "1Logging\1Logging.csproj", "{98270ED7-04C7-4F90-91B1-820C672CE123}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "2EditDatabase", "2EditDatabase\2EditDatabase.csproj", "{42BF3751-D744-4373-B5CC-704A0CCA0106}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "3EditSptConfig", "3EditSptConfig\3EditSptConfig.csproj", "{CE1A0F24-D1CB-4E12-8462-13641A7FB964}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "4ReadCustomJson5Config", "4ReadCustomJson5Config\4ReadCustomJson5Config.csproj", "{CEFCC99D-C0C7-4894-93D9-3B6F3BAFD92F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "5ReadCustomJsonConfig", "5ReadCustomJsonConfig\5ReadCustomJsonConfig.csproj", "{00CE855D-299F-4700-84C2-0567060593DF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "6OverrideMethod", "6OverrideMethod\6OverrideMethod.csproj", "{494C6DB5-EAD2-4DCA-871A-34675D2452DE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "7UseMultipleClasses", "7UseMultipleClasses\7UseMultipleClasses.csproj", "{B6DE92DC-7ADB-4E5E-BECF-68C829D7CBCA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "8OnLoad", "8OnLoad\8OnLoad.csproj", "{556E07A1-E399-4761-89C0-AC74E6A20BA1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "9OnUpdate", "9OnUpdate\9OnUpdate.csproj", "{113E9B1C-25E4-4DB3-9724-A48684A40B91}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "10CustomRoute", "10CustomRoute\10CustomRoute.csproj", "{4AF609A6-91C8-48CC-8D4B-9454864C98E2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "11RegisterClassesInDI", "11RegisterClassesInDI\11RegisterClassesInDI.csproj", "{5B705F9E-7F4F-491A-8215-30EE5B5D77B0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "12Bundle", "12Bundle\12Bundle.csproj", "{FE769EA8-4F31-4426-90A3-A1EFA8A43D6E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "13AddTraderWithAssortJson", "13AddTraderWithAssortJson\13AddTraderWithAssortJson.csproj", "{636D5797-E37F-425A-B8DB-E3FBE4573F71}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "14AfterDBLoadHook", "14AfterDBLoadHook\14AfterDBLoadHook.csproj", "{B4DDC0E8-99D1-405E-9E01-823523FE642B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "15HttpListenerExample", "15HttpListenerExample\15HttpListenerExample.csproj", "{15F2B434-439E-498E-9B85-B7BBC2F4AFA4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "18CustomItemService", "18CustomItemService\18CustomItemService.csproj", "{ADE10F29-58D6-4C13-B217-7C737DFB413A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "18.1CustomItemServiceLootBox", "18.1CustomItemServiceLootBox\18.1CustomItemServiceLootBox.csproj", "{B870C285-B435-4C40-89C4-0220D34CB9BE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "20CustomChatBot", "20CustomChatBot\20CustomChatBot.csproj", "{32271491-8CF1-4014-9A8E-E1EA22EA4292}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "13.1AddTraderWithDynamicAssorts", "13.1AddTraderWithDynamicAssorts\13.1AddTraderWithDynamicAssorts.csproj", "{9038FA64-E484-4549-9728-C50F12BBE643}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "21CustomCommandoCommand", "21CustomCommandoCommand\21CustomCommandoCommand.csproj", "{A7D491BC-94C0-4AC9-9190-1FCA05D09B19}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "22CustomSptCommand", "22CustomSptCommand\22CustomSptCommand.csproj", "{7FB8C9B5-CEBF-4E76-9EC3-670EE57B328B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "23CustomAbstractChatBot", "23CustomAbstractChatBot\23CustomAbstractChatBot.csproj", "{B97A7EE2-04DD-4690-866E-9179F5E01908}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "24Websocket", "24Websocket\24Websocket.csproj", "{94B1B1E4-C47D-4AA7-BA3A-88F3D30439DF}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {98270ED7-04C7-4F90-91B1-820C672CE123}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {98270ED7-04C7-4F90-91B1-820C672CE123}.Debug|Any CPU.Build.0 = Debug|Any CPU - {98270ED7-04C7-4F90-91B1-820C672CE123}.Release|Any CPU.ActiveCfg = Release|Any CPU - {98270ED7-04C7-4F90-91B1-820C672CE123}.Release|Any CPU.Build.0 = Release|Any CPU - {42BF3751-D744-4373-B5CC-704A0CCA0106}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {42BF3751-D744-4373-B5CC-704A0CCA0106}.Debug|Any CPU.Build.0 = Debug|Any CPU - {42BF3751-D744-4373-B5CC-704A0CCA0106}.Release|Any CPU.ActiveCfg = Release|Any CPU - {42BF3751-D744-4373-B5CC-704A0CCA0106}.Release|Any CPU.Build.0 = Release|Any CPU - {CE1A0F24-D1CB-4E12-8462-13641A7FB964}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE1A0F24-D1CB-4E12-8462-13641A7FB964}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE1A0F24-D1CB-4E12-8462-13641A7FB964}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE1A0F24-D1CB-4E12-8462-13641A7FB964}.Release|Any CPU.Build.0 = Release|Any CPU - {CEFCC99D-C0C7-4894-93D9-3B6F3BAFD92F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CEFCC99D-C0C7-4894-93D9-3B6F3BAFD92F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CEFCC99D-C0C7-4894-93D9-3B6F3BAFD92F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CEFCC99D-C0C7-4894-93D9-3B6F3BAFD92F}.Release|Any CPU.Build.0 = Release|Any CPU - {00CE855D-299F-4700-84C2-0567060593DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {00CE855D-299F-4700-84C2-0567060593DF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {00CE855D-299F-4700-84C2-0567060593DF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {00CE855D-299F-4700-84C2-0567060593DF}.Release|Any CPU.Build.0 = Release|Any CPU - {494C6DB5-EAD2-4DCA-871A-34675D2452DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {494C6DB5-EAD2-4DCA-871A-34675D2452DE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {494C6DB5-EAD2-4DCA-871A-34675D2452DE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {494C6DB5-EAD2-4DCA-871A-34675D2452DE}.Release|Any CPU.Build.0 = Release|Any CPU - {B6DE92DC-7ADB-4E5E-BECF-68C829D7CBCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B6DE92DC-7ADB-4E5E-BECF-68C829D7CBCA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B6DE92DC-7ADB-4E5E-BECF-68C829D7CBCA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B6DE92DC-7ADB-4E5E-BECF-68C829D7CBCA}.Release|Any CPU.Build.0 = Release|Any CPU - {556E07A1-E399-4761-89C0-AC74E6A20BA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {556E07A1-E399-4761-89C0-AC74E6A20BA1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {556E07A1-E399-4761-89C0-AC74E6A20BA1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {556E07A1-E399-4761-89C0-AC74E6A20BA1}.Release|Any CPU.Build.0 = Release|Any CPU - {113E9B1C-25E4-4DB3-9724-A48684A40B91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {113E9B1C-25E4-4DB3-9724-A48684A40B91}.Debug|Any CPU.Build.0 = Debug|Any CPU - {113E9B1C-25E4-4DB3-9724-A48684A40B91}.Release|Any CPU.ActiveCfg = Release|Any CPU - {113E9B1C-25E4-4DB3-9724-A48684A40B91}.Release|Any CPU.Build.0 = Release|Any CPU - {4AF609A6-91C8-48CC-8D4B-9454864C98E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4AF609A6-91C8-48CC-8D4B-9454864C98E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4AF609A6-91C8-48CC-8D4B-9454864C98E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4AF609A6-91C8-48CC-8D4B-9454864C98E2}.Release|Any CPU.Build.0 = Release|Any CPU - {5B705F9E-7F4F-491A-8215-30EE5B5D77B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5B705F9E-7F4F-491A-8215-30EE5B5D77B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5B705F9E-7F4F-491A-8215-30EE5B5D77B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5B705F9E-7F4F-491A-8215-30EE5B5D77B0}.Release|Any CPU.Build.0 = Release|Any CPU - {FE769EA8-4F31-4426-90A3-A1EFA8A43D6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FE769EA8-4F31-4426-90A3-A1EFA8A43D6E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FE769EA8-4F31-4426-90A3-A1EFA8A43D6E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FE769EA8-4F31-4426-90A3-A1EFA8A43D6E}.Release|Any CPU.Build.0 = Release|Any CPU - {636D5797-E37F-425A-B8DB-E3FBE4573F71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {636D5797-E37F-425A-B8DB-E3FBE4573F71}.Debug|Any CPU.Build.0 = Debug|Any CPU - {636D5797-E37F-425A-B8DB-E3FBE4573F71}.Release|Any CPU.ActiveCfg = Release|Any CPU - {636D5797-E37F-425A-B8DB-E3FBE4573F71}.Release|Any CPU.Build.0 = Release|Any CPU - {B4DDC0E8-99D1-405E-9E01-823523FE642B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B4DDC0E8-99D1-405E-9E01-823523FE642B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B4DDC0E8-99D1-405E-9E01-823523FE642B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B4DDC0E8-99D1-405E-9E01-823523FE642B}.Release|Any CPU.Build.0 = Release|Any CPU - {15F2B434-439E-498E-9B85-B7BBC2F4AFA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {15F2B434-439E-498E-9B85-B7BBC2F4AFA4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {15F2B434-439E-498E-9B85-B7BBC2F4AFA4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {15F2B434-439E-498E-9B85-B7BBC2F4AFA4}.Release|Any CPU.Build.0 = Release|Any CPU - {ADE10F29-58D6-4C13-B217-7C737DFB413A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ADE10F29-58D6-4C13-B217-7C737DFB413A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ADE10F29-58D6-4C13-B217-7C737DFB413A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ADE10F29-58D6-4C13-B217-7C737DFB413A}.Release|Any CPU.Build.0 = Release|Any CPU - {B870C285-B435-4C40-89C4-0220D34CB9BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B870C285-B435-4C40-89C4-0220D34CB9BE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B870C285-B435-4C40-89C4-0220D34CB9BE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B870C285-B435-4C40-89C4-0220D34CB9BE}.Release|Any CPU.Build.0 = Release|Any CPU - {32271491-8CF1-4014-9A8E-E1EA22EA4292}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {32271491-8CF1-4014-9A8E-E1EA22EA4292}.Debug|Any CPU.Build.0 = Debug|Any CPU - {32271491-8CF1-4014-9A8E-E1EA22EA4292}.Release|Any CPU.ActiveCfg = Release|Any CPU - {32271491-8CF1-4014-9A8E-E1EA22EA4292}.Release|Any CPU.Build.0 = Release|Any CPU - {9038FA64-E484-4549-9728-C50F12BBE643}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9038FA64-E484-4549-9728-C50F12BBE643}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9038FA64-E484-4549-9728-C50F12BBE643}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9038FA64-E484-4549-9728-C50F12BBE643}.Release|Any CPU.Build.0 = Release|Any CPU - {A7D491BC-94C0-4AC9-9190-1FCA05D09B19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A7D491BC-94C0-4AC9-9190-1FCA05D09B19}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A7D491BC-94C0-4AC9-9190-1FCA05D09B19}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A7D491BC-94C0-4AC9-9190-1FCA05D09B19}.Release|Any CPU.Build.0 = Release|Any CPU - {7FB8C9B5-CEBF-4E76-9EC3-670EE57B328B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7FB8C9B5-CEBF-4E76-9EC3-670EE57B328B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7FB8C9B5-CEBF-4E76-9EC3-670EE57B328B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7FB8C9B5-CEBF-4E76-9EC3-670EE57B328B}.Release|Any CPU.Build.0 = Release|Any CPU - {B97A7EE2-04DD-4690-866E-9179F5E01908}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B97A7EE2-04DD-4690-866E-9179F5E01908}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B97A7EE2-04DD-4690-866E-9179F5E01908}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B97A7EE2-04DD-4690-866E-9179F5E01908}.Release|Any CPU.Build.0 = Release|Any CPU - {94B1B1E4-C47D-4AA7-BA3A-88F3D30439DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {94B1B1E4-C47D-4AA7-BA3A-88F3D30439DF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {94B1B1E4-C47D-4AA7-BA3A-88F3D30439DF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {94B1B1E4-C47D-4AA7-BA3A-88F3D30439DF}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/ModExamples/TempReferences/Core.dll b/ModExamples/TempReferences/Core.dll deleted file mode 100644 index ed872f3e..00000000 Binary files a/ModExamples/TempReferences/Core.dll and /dev/null differ diff --git a/ModExamples/TempReferences/SptCommon.dll b/ModExamples/TempReferences/SptCommon.dll deleted file mode 100644 index 10ce74b7..00000000 Binary files a/ModExamples/TempReferences/SptCommon.dll and /dev/null differ diff --git a/ModExamples/TempReferences/SptDependencyInjection.dll b/ModExamples/TempReferences/SptDependencyInjection.dll deleted file mode 100644 index ce2fee3b..00000000 Binary files a/ModExamples/TempReferences/SptDependencyInjection.dll and /dev/null differ diff --git a/Server/Server.csproj b/Server/Server.csproj index 424a8bd9..b2fd2a38 100644 --- a/Server/Server.csproj +++ b/Server/Server.csproj @@ -1,9 +1,14 @@ - SPT.Server - SPT Team + SPTarkov.Server + Single Player Tarkov + Single Player Tarkov server launcher. + Copyright (c) Single Player Tarkov 2025 + LICENSE + https://sp-tarkov.com https://github.com/sp-tarkov/server-csharp + git true false net9.0 @@ -43,4 +48,8 @@ + + + +