mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
27 lines
921 B
C#
27 lines
921 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Net;
|
|
using System.Text;
|
|
|
|
namespace ET.Server
|
|
{
|
|
[HttpHandler(SceneType.RouterManager, "/get_router")]
|
|
public class HttpGetRouterHandler : IHttpHandler
|
|
{
|
|
public async ETTask Handle(Scene scene, HttpListenerContext context)
|
|
{
|
|
HttpGetRouterResponse response = new();
|
|
foreach (StartSceneConfig startSceneConfig in StartSceneConfigCategory.Instance.Realms)
|
|
{
|
|
response.Realms.Add(startSceneConfig.InnerIPPort.ToString());
|
|
}
|
|
foreach (StartSceneConfig startSceneConfig in StartSceneConfigCategory.Instance.Routers)
|
|
{
|
|
response.Routers.Add($"{startSceneConfig.StartProcessConfig.OuterIP}:{startSceneConfig.Port}");
|
|
}
|
|
HttpHelper.Response(context, response);
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
}
|