添加 Web API 的 OnWebAPIStarted 事件

This commit is contained in:
milimoe 2025-07-16 00:02:45 +08:00
parent 620a398f47
commit 1823e00669
Signed by: milimoe
GPG Key ID: 9554D37E4B8991D0
2 changed files with 18 additions and 0 deletions

View File

@ -238,6 +238,21 @@ namespace Milimoe.FunGame.Server.Services
ServerHelper.Error(e); ServerHelper.Error(e);
} }
} }
/// <summary>
/// Web API 启动完成回调
/// </summary>
public static void OnWebAPIStarted(params object[] objs)
{
try
{
WebAPIPluginLoader?.OnWebAPIStarted(objs);
}
catch (Exception e)
{
ServerHelper.Error(e);
}
}
/// <summary> /// <summary>
/// 服务器启动登记 /// 服务器启动登记

View File

@ -258,6 +258,9 @@ try
Task order = Task.Factory.StartNew(GetConsoleOrder); Task order = Task.Factory.StartNew(GetConsoleOrder);
otherobjs = [app, listener];
FunGameSystem.OnWebAPIStarted(otherobjs);
app.Run(); app.Run();
} }
catch (Exception e) catch (Exception e)