ac7b2daeba
Added OnLoad mod Expanded `OnLoadOrder` options
29 lines
746 B
C#
29 lines
746 B
C#
using Core.Context;
|
|
using Core.DI;
|
|
using Core.Servers;
|
|
using SptCommon.Annotations;
|
|
|
|
namespace Core.Callbacks;
|
|
|
|
[Injectable(InjectionType.Singleton, InjectableTypeOverride = typeof(IOnLoad), TypePriority = OnLoadOrder.HttpCallbacks)]
|
|
public class HttpCallbacks(HttpServer _httpServer, ApplicationContext _applicationContext) : IOnLoad
|
|
{
|
|
public Task OnLoad()
|
|
{
|
|
_httpServer.Load(_applicationContext.GetLatestValue(ContextVariableType.APP_BUILDER)?.GetValue<WebApplicationBuilder>());
|
|
_applicationContext.ClearValues(ContextVariableType.APP_BUILDER);
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public string GetRoute()
|
|
{
|
|
return "spt-http";
|
|
}
|
|
|
|
public string GetImage()
|
|
{
|
|
return "";
|
|
}
|
|
}
|