aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Horizon/Bcat/BcatServerManager.cs
diff options
context:
space:
mode:
authorEmmanuel Hansen <emmausssss@gmail.com>2023-05-09 21:46:23 +0000
committerGitHub <noreply@github.com>2023-05-09 21:46:23 +0000
commit0bc8151c7ecdacc1506305a8d60e7b3c7b13622d (patch)
treec14b5a4463764a0f86285054cea813e242950ba2 /src/Ryujinx.Horizon/Bcat/BcatServerManager.cs
parent40c17673f5a1a7c96f548dc4efaf05bba832a340 (diff)
IPC - Refactor Bcat service to use new ipc - Revisit (#4803)
* bcat ipc * fix hipc buffer flags * add buffer fixed size flag on generator
Diffstat (limited to 'src/Ryujinx.Horizon/Bcat/BcatServerManager.cs')
-rw-r--r--src/Ryujinx.Horizon/Bcat/BcatServerManager.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Ryujinx.Horizon/Bcat/BcatServerManager.cs b/src/Ryujinx.Horizon/Bcat/BcatServerManager.cs
new file mode 100644
index 00000000..f02eafd9
--- /dev/null
+++ b/src/Ryujinx.Horizon/Bcat/BcatServerManager.cs
@@ -0,0 +1,28 @@
+using Ryujinx.Horizon.Bcat.Ipc;
+using Ryujinx.Horizon.Bcat.Types;
+using Ryujinx.Horizon.Common;
+using Ryujinx.Horizon.Sdk.Sf.Hipc;
+using Ryujinx.Horizon.Sdk.Sm;
+using System;
+
+namespace Ryujinx.Horizon.Bcat
+{
+ class BcatServerManager : ServerManager
+ {
+ public BcatServerManager(HeapAllocator allocator, SmApi sm, int maxPorts, ManagerOptions options, int maxSessions) : base(allocator, sm, maxPorts, options, maxSessions)
+ {
+ }
+
+ protected override Result OnNeedsToAccept(int portIndex, Server server)
+ {
+ return (BcatPortIndex)portIndex switch
+ {
+ BcatPortIndex.Admin => AcceptImpl(server, new ServiceCreator("bcat:a", BcatServicePermissionLevel.Admin)),
+ BcatPortIndex.Manager => AcceptImpl(server, new ServiceCreator("bcat:m", BcatServicePermissionLevel.Manager)),
+ BcatPortIndex.User => AcceptImpl(server, new ServiceCreator("bcat:u", BcatServicePermissionLevel.User)),
+ BcatPortIndex.System => AcceptImpl(server, new ServiceCreator("bcat:s", BcatServicePermissionLevel.System)),
+ _ => throw new ArgumentOutOfRangeException(nameof(portIndex)),
+ };
+ }
+ }
+} \ No newline at end of file