mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-15 23:20:33 +00:00
2989c163a8
* editorconfig: Add default charset * Change file encoding from UTF-8-BOM to UTF-8
30 lines
1 KiB
C#
30 lines
1 KiB
C#
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)),
|
|
};
|
|
}
|
|
}
|
|
}
|