From 4be37a3703547bde678ae7b4f1ee1bbca6aa0e76 Mon Sep 17 00:00:00 2001 From: Shyanne Date: Wed, 28 Jan 2026 00:18:21 -0500 Subject: [PATCH 1/7] [HLE] Stubbed IUserLocalCommuniationService:SetProtocol (106) Should fix Animal Crossing: New Horizons crashing on LDN connection and potentially other titles with Switch 2 updates. --- .../IUserLocalCommunicationService.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs index 62a86ad91..abf4153d0 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs @@ -487,6 +487,23 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator return ResultCode.Success; } + [CommandCmif(106)] // 20.0.0+ + // SetProtocol + public ResultCode SetProtocol(ServiceCtx context) + { + uint protocolValue = context.RequestData.ReadUInt32(); + + // On NX only input value 1 or 3 is allowed, with an error being thrown otherwise. + if (protocolValue != 1 || protocolValue != 3) + { + throw new NotSupportedException($"Protocol value is {protocolValue}!!"); + } + + Logger.Info?.PrintMsg(LogClass.ServiceLdn, $"Protocol value: {protocolValue}"); + Logger.Stub?.PrintMsg(LogClass.ServiceLdn, "IUserLocalCommunicationService SetProtocol: Stubbed."); + return ResultCode.Success; + } + [CommandCmif(200)] // OpenAccessPoint() public ResultCode OpenAccessPoint(ServiceCtx context) From abca04c8f926d781a591f957c46f9c8d9a7a048b Mon Sep 17 00:00:00 2001 From: Shyanne Date: Wed, 28 Jan 2026 00:18:21 -0500 Subject: [PATCH 2/7] [HLE] Stubbed IUserLocalCommuniationService:SetProtocol (106) Should fix Animal Crossing: New Horizons crashing on LDN connection and potentially other titles with Switch 2 updates. --- .../IUserLocalCommunicationService.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs index 62a86ad91..abf4153d0 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs @@ -487,6 +487,23 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator return ResultCode.Success; } + [CommandCmif(106)] // 20.0.0+ + // SetProtocol + public ResultCode SetProtocol(ServiceCtx context) + { + uint protocolValue = context.RequestData.ReadUInt32(); + + // On NX only input value 1 or 3 is allowed, with an error being thrown otherwise. + if (protocolValue != 1 || protocolValue != 3) + { + throw new NotSupportedException($"Protocol value is {protocolValue}!!"); + } + + Logger.Info?.PrintMsg(LogClass.ServiceLdn, $"Protocol value: {protocolValue}"); + Logger.Stub?.PrintMsg(LogClass.ServiceLdn, "IUserLocalCommunicationService SetProtocol: Stubbed."); + return ResultCode.Success; + } + [CommandCmif(200)] // OpenAccessPoint() public ResultCode OpenAccessPoint(ServiceCtx context) From 57e0aa69a8bf8783bc70a995e3e799e2fac3d590 Mon Sep 17 00:00:00 2001 From: Shyanne Date: Wed, 28 Jan 2026 00:43:45 -0500 Subject: [PATCH 3/7] fixed stub and updated exception thrown --- .../Ldn/UserServiceCreator/IUserLocalCommunicationService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs index abf4153d0..d891a32a5 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs @@ -5,6 +5,7 @@ using Ryujinx.Common.Logging; using Ryujinx.Common.Memory; using Ryujinx.Common.Utilities; using Ryujinx.Cpu; +using Ryujinx.HLE.Exceptions; using Ryujinx.HLE.HOS.Ipc; using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Services.Ldn.Types; @@ -496,11 +497,11 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator // On NX only input value 1 or 3 is allowed, with an error being thrown otherwise. if (protocolValue != 1 || protocolValue != 3) { - throw new NotSupportedException($"Protocol value is {protocolValue}!!"); + throw new ServiceNotImplementedException(this, context, $"{GetType().FullName}: Protocol value is {protocolValue}!!"); } Logger.Info?.PrintMsg(LogClass.ServiceLdn, $"Protocol value: {protocolValue}"); - Logger.Stub?.PrintMsg(LogClass.ServiceLdn, "IUserLocalCommunicationService SetProtocol: Stubbed."); + Logger.Stub?.PrintStub(LogClass.ServiceLdn); return ResultCode.Success; } From 0a0669a8b14474bfa456d50da7404c4a77846bfa Mon Sep 17 00:00:00 2001 From: Shyanne Date: Wed, 28 Jan 2026 11:16:32 -0500 Subject: [PATCH 4/7] Update IUserLocalCommunicationService.cs --- .../Ldn/UserServiceCreator/IUserLocalCommunicationService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs index d891a32a5..a2aef0dbf 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs @@ -15,6 +15,7 @@ using Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.Types; using Ryujinx.Horizon.Common; using Ryujinx.Memory; using System; +using System.ComponentModel; using System.IO; using System.Net; using System.Net.NetworkInformation; @@ -500,8 +501,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator throw new ServiceNotImplementedException(this, context, $"{GetType().FullName}: Protocol value is {protocolValue}!!"); } - Logger.Info?.PrintMsg(LogClass.ServiceLdn, $"Protocol value: {protocolValue}"); - Logger.Stub?.PrintStub(LogClass.ServiceLdn); + Logger.Stub?.PrintStub(LogClass.ServiceLdn, $"Protocol value: {protocolValue}"); return ResultCode.Success; } From e63d37807a843cb4400f10731fdc3e830e8f284c Mon Sep 17 00:00:00 2001 From: Shyanne Date: Wed, 28 Jan 2026 11:46:24 -0500 Subject: [PATCH 5/7] Update IUserLocalCommunicationService.cs --- .../Ldn/UserServiceCreator/IUserLocalCommunicationService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs index a2aef0dbf..6056fec2b 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs @@ -498,7 +498,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator // On NX only input value 1 or 3 is allowed, with an error being thrown otherwise. if (protocolValue != 1 || protocolValue != 3) { - throw new ServiceNotImplementedException(this, context, $"{GetType().FullName}: Protocol value is {protocolValue}!!"); + throw new ArgumentException($"{GetType().FullName}: Protocol value is not 1 or 3!! Protocol value: {protocolValue}"); } Logger.Stub?.PrintStub(LogClass.ServiceLdn, $"Protocol value: {protocolValue}"); From a6dbefc0cd1301d8af6982baed9a83c331568f3c Mon Sep 17 00:00:00 2001 From: Shyanne Date: Wed, 28 Jan 2026 19:15:35 -0500 Subject: [PATCH 6/7] Update IUserLocalCommunicationService.cs --- .../Ldn/UserServiceCreator/IUserLocalCommunicationService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs index 6056fec2b..fd591ae6d 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs @@ -496,7 +496,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator uint protocolValue = context.RequestData.ReadUInt32(); // On NX only input value 1 or 3 is allowed, with an error being thrown otherwise. - if (protocolValue != 1 || protocolValue != 3) + if (protocolValue != 1 && protocolValue != 3) { throw new ArgumentException($"{GetType().FullName}: Protocol value is not 1 or 3!! Protocol value: {protocolValue}"); } From edb665f1144f59ba7799d1be2c25628e1d80fbd3 Mon Sep 17 00:00:00 2001 From: Shyanne Date: Wed, 28 Jan 2026 19:21:28 -0500 Subject: [PATCH 7/7] if it is NOT 1 or 3 (so if it is not 1 AND if it is not 3) --- .../Ldn/UserServiceCreator/IUserLocalCommunicationService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs index fd591ae6d..c36fda775 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/IUserLocalCommunicationService.cs @@ -496,7 +496,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator uint protocolValue = context.RequestData.ReadUInt32(); // On NX only input value 1 or 3 is allowed, with an error being thrown otherwise. - if (protocolValue != 1 && protocolValue != 3) + if (!(protocolValue == 1 || protocolValue == 3)) { throw new ArgumentException($"{GetType().FullName}: Protocol value is not 1 or 3!! Protocol value: {protocolValue}"); }