Update Mods to be foldered/ own csproj/ ref dll

This commit is contained in:
CWX
2025-02-10 15:04:40 +00:00
parent ed54312f35
commit 7cd8ef9179
49 changed files with 361 additions and 121 deletions
@@ -0,0 +1,46 @@
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<RouteAction> 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
{
}