Added package jsons to mods + updated related poco
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"Name": "1Logging",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"Name": "6ReplaceMethod",
|
||||
"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"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ExampleMods.Mods._7UseMultipleClasses
|
||||
{
|
||||
public class SecondClass
|
||||
{
|
||||
public string GetText()
|
||||
{
|
||||
return "test text";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using Core.Models.External;
|
||||
using Core.Models.Utils;
|
||||
|
||||
namespace ExampleMods.Mods._7UseMultipleClasses
|
||||
{
|
||||
/// <summary>
|
||||
/// Having multiple classes can make keeping your code maintainable easier, you can split related code into their own class
|
||||
/// </summary>
|
||||
public class UseMultipleClasses: IPostDBLoadMod
|
||||
{
|
||||
private readonly ISptLogger<UseMultipleClasses> _logger;
|
||||
|
||||
public UseMultipleClasses(
|
||||
ISptLogger<UseMultipleClasses> _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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
@@ -62,18 +62,6 @@ public record PackageJsonData
|
||||
set;
|
||||
}
|
||||
|
||||
public Dictionary<string, string>? Scripts
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Dictionary<string, string>? DevDependencies
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string? Licence
|
||||
{
|
||||
get;
|
||||
|
||||
Reference in New Issue
Block a user