HandlerRegistration #2

Merged
Kayori merged 4 commits from HandlerRegistration into main 2024-08-19 07:27:10 +00:00
2 changed files with 12 additions and 6 deletions
Showing only changes of commit 22623b11b5 - Show all commits

View File

@ -11,7 +11,7 @@ namespace Medusa.Core.Handlers.Boot
private readonly IServer _server = server;
private readonly ILogger<GetServicesHandler> _logger = logger;
private readonly XDocument _body = body;
private const string CommonUrl = "http://127.0.0.1:8083/";
private const string CommonUrl = "http://127.0.0.1:8083/ea";
private string listeningAddress = "http://127.0.0.1:8083";
public Task<XDocument> HandleAsync(string model)
@ -52,7 +52,7 @@ namespace Medusa.Core.Handlers.Boot
{
services.Add(new XElement("item",
new XAttribute("name", service),
new XAttribute("url", $"{CommonUrl}{service}")));
new XAttribute("url", $"{CommonUrl}/{service}")));
}
services.Add(new XElement("item", new XAttribute("name", "ntp"),
@ -80,7 +80,10 @@ namespace Medusa.Core.Handlers.Boot
private static void AddMdxServices(XElement services)
{
const string mdxurl = $"{CommonUrl}";
string[] mdxServices = ["local"];
string[] mdxServices = [
"local", "local2", "lobby", "slocal", "slocal2", "sglocal", "sglocal2", "lab", "globby",
"slobby", "sglobby"
];
foreach(string service in mdxServices)
services.Add(new XElement("item", new XAttribute("name", service), new XAttribute("url", mdxurl)));
@ -89,7 +92,10 @@ namespace Medusa.Core.Handlers.Boot
private static void AddM39Services(XElement services)
{
const string m39url = $"{CommonUrl}";
string[] m39Services = ["local"];
string[] m39Services = [
"local", "local2", "lobby", "slocal", "slocal2", "sglocal", "sglocal2", "lab", "globby",
"slobby", "sglobby"
];
foreach(string service in m39Services)
services.Add(new XElement("item", new XAttribute("name", service), new XAttribute("url", m39url)));

View File

@ -16,7 +16,7 @@ namespace Medusa.Core.Handlers.Common
public Task<XDocument> HandleAsync(string model)
{
var port = "5293";
var port = "8083";
var facility = new XElement("facility",
new XAttribute("status", "0"));
@ -33,7 +33,7 @@ namespace Medusa.Core.Handlers.Common
new XElement("class", 0, new XAttribute("__type", "u8")));
var portfw = new XElement("portfw",
new XElement("globalip", "127.0.0.1", new XAttribute("__type", "ip4")),
new XElement("globalip", "0.0.0.0", new XAttribute("__type", "ip4")),
new XElement("globalport", port, new XAttribute("__type", "u16")),
new XElement("privateport", port, new XAttribute("__type", "u16")));