aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Horizon/Sm/SmServerManager.cs
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2023-01-08 13:13:39 +0100
committerGitHub <noreply@github.com>2023-01-08 12:13:39 +0000
commit550747eac6c0f6da14070c8b6d208bde6f1d1eb9 (patch)
tree1be203777156dae17a4221589c852c638b273d94 /Ryujinx.Horizon/Sm/SmServerManager.cs
parent3ffceab1fb220c13f5982de599d788f2e3e7cc47 (diff)
Horizon: Impl Prepo, Fixes bugs, Clean things (#4220)1.1.519
* Horizon: Impl Prepo, Fixes bugs, Clean things * remove ToArray() * resultCode > status * Remove old services * Addresses gdkchan's comments and more cleanup * Addresses Gdkchan's feedback 2 * Reorganize services, make sure service are loaded before guest Co-Authored-By: gdkchan <5624669+gdkchan@users.noreply.github.com> * Create interfaces for lm and sm Co-authored-by: gdkchan <5624669+gdkchan@users.noreply.github.com>
Diffstat (limited to 'Ryujinx.Horizon/Sm/SmServerManager.cs')
-rw-r--r--Ryujinx.Horizon/Sm/SmServerManager.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/Ryujinx.Horizon/Sm/SmServerManager.cs b/Ryujinx.Horizon/Sm/SmServerManager.cs
new file mode 100644
index 00000000..dc8dc5b6
--- /dev/null
+++ b/Ryujinx.Horizon/Sm/SmServerManager.cs
@@ -0,0 +1,30 @@
+using Ryujinx.Horizon.Common;
+using Ryujinx.Horizon.Sdk.Sf.Hipc;
+using Ryujinx.Horizon.Sdk.Sm;
+using Ryujinx.Horizon.Sm.Impl;
+using Ryujinx.Horizon.Sm.Ipc;
+using Ryujinx.Horizon.Sm.Types;
+using System;
+
+namespace Ryujinx.Horizon.Sm
+{
+ class SmServerManager : ServerManager
+ {
+ private readonly ServiceManager _serviceManager;
+
+ public SmServerManager(ServiceManager serviceManager, HeapAllocator allocator, SmApi sm, int maxPorts, ManagerOptions options, int maxSessions) : base(allocator, sm, maxPorts, options, maxSessions)
+ {
+ _serviceManager = serviceManager;
+ }
+
+ protected override Result OnNeedsToAccept(int portIndex, Server server)
+ {
+ return (SmPortIndex)portIndex switch
+ {
+ SmPortIndex.User => AcceptImpl(server, new UserService(_serviceManager)),
+ SmPortIndex.Manager => AcceptImpl(server, new ManagerService()),
+ _ => throw new ArgumentOutOfRangeException(nameof(portIndex)),
+ };
+ }
+ }
+} \ No newline at end of file