mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 112dbe2a31f72854190a5ac197d5e1fe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user