80f759a0da
* Add edge case for Reverse Proxies * Cleanup HttpListener, remove unecessary MemoryStreams * Handle with IPAddress instead of string * Handle nullabiity of RouteAction, tighten typing on requests * Cleanup HttpRouter * Use tighter typing on Routers
32 lines
1.2 KiB
C#
32 lines
1.2 KiB
C#
using SPTarkov.DI.Annotations;
|
|
using SPTarkov.Server.Core.Callbacks;
|
|
using SPTarkov.Server.Core.DI;
|
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
|
using SPTarkov.Server.Core.Utils;
|
|
|
|
namespace SPTarkov.Server.Core.Routers.Dynamic;
|
|
|
|
[Injectable]
|
|
public class NotifierDynamicRouter(JsonUtil jsonUtil, NotifierCallbacks notifierCallbacks)
|
|
: DynamicRouter(
|
|
jsonUtil,
|
|
[
|
|
new RouteAction<EmptyRequestData>(
|
|
"/?last_id",
|
|
async (url, info, sessionID, _) => await notifierCallbacks.Notify(url, info, sessionID)
|
|
),
|
|
new RouteAction<EmptyRequestData>(
|
|
"/notifierServer",
|
|
async (url, info, sessionID, _) => await notifierCallbacks.Notify(url, info, sessionID)
|
|
),
|
|
new RouteAction<EmptyRequestData>(
|
|
"/push/notifier/get/",
|
|
async (url, info, sessionID, _) => await notifierCallbacks.GetNotifier(url, info, sessionID)
|
|
),
|
|
new RouteAction<EmptyRequestData>(
|
|
"/push/notifier/get/",
|
|
async (url, info, sessionID, _) => await notifierCallbacks.GetNotifier(url, info, sessionID)
|
|
),
|
|
]
|
|
) { }
|