Decrease timeout on uPNP to avoid timeout issue on smash bros and change debug statements to Info

This commit is contained in:
Vudjun 2025-02-08 23:14:29 +00:00
parent d406c42e15
commit bcbe589964

View File

@ -112,7 +112,8 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
private async Task<ushort> NatPunchForDevice(NatDevice device) private async Task<ushort> NatPunchForDevice(NatDevice device)
{ {
Logger.Trace?.PrintMsg(LogClass.ServiceLdn, $"Attempting to map port using {device.ToString()}"); Logger.Info?.PrintMsg(LogClass.ServiceLdn, $"Attempting to map port using {device.ToString()}");
_publicPort = PublicPortBase;
for (int i = 0; i < PublicPortRange; i++) for (int i = 0; i < PublicPortRange; i++)
{ {
try try
@ -125,12 +126,12 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
} }
catch (MappingException ex) catch (MappingException ex)
{ {
Logger.Trace?.PrintMsg(LogClass.ServiceLdn, $"Failed to map port {_publicPort}: {ex.Message}"); Logger.Info?.PrintMsg(LogClass.ServiceLdn, $"Failed to map port {_publicPort}: {ex.Message}");
_publicPort++; _publicPort++;
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.Trace?.PrintMsg(LogClass.ServiceLdn, $"Failed to map port {_publicPort}: {ex.GetType().Name}: {ex.Message}"); Logger.Info?.PrintMsg(LogClass.ServiceLdn, $"Failed to map port {_publicPort}: {ex.GetType().Name}: {ex.Message}");
return 0; return 0;
} }
@ -155,7 +156,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
public async Task<ushort> NatPunch() public async Task<ushort> NatPunch()
{ {
NatDiscoverer discoverer = new(); NatDiscoverer discoverer = new();
CancellationTokenSource cts = new(5000); CancellationTokenSource cts = new(500);
NatDevice[] devices; NatDevice[] devices;
@ -177,7 +178,6 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
foreach (var device in devices) foreach (var device in devices)
{ {
_publicPort = PublicPortBase;
ushort port = await NatPunchForDevice(device); ushort port = await NatPunchForDevice(device);
if (port != 0) if (port != 0)
{ {
@ -185,6 +185,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
} }
} }
Logger.Info?.PrintMsg(LogClass.ServiceLdn, $"Failed to map port using any device"); Logger.Info?.PrintMsg(LogClass.ServiceLdn, $"Failed to map port using any device");
_publicPort = 0;
return 0; return 0;
} }