mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-10-02 16:50:20 -07:00

* Migrate friends service to new IPC * Add a note that the pointer buffer size and domain counts are wrong * Wrong length * Format whitespace * PR feedback * Fill in structs from PR feedback * Missed that one * Somehow forgot to save that one * Fill in enums from PR review * Language enum, NotificationTime * Format whitespace * Fix the warning
52 lines
1.7 KiB
C#
52 lines
1.7 KiB
C#
using Ryujinx.Horizon.Common;
|
|
using Ryujinx.Horizon.Sdk.Account;
|
|
using Ryujinx.Horizon.Sdk.Sf;
|
|
|
|
namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
|
{
|
|
partial class ServiceCreator : IServiceCreator
|
|
{
|
|
private readonly IEmulatorAccountManager _accountManager;
|
|
private readonly NotificationEventHandler _notificationEventHandler;
|
|
private readonly FriendsServicePermissionLevel _permissionLevel;
|
|
|
|
public ServiceCreator(IEmulatorAccountManager accountManager, NotificationEventHandler notificationEventHandler, FriendsServicePermissionLevel permissionLevel)
|
|
{
|
|
_accountManager = accountManager;
|
|
_notificationEventHandler = notificationEventHandler;
|
|
_permissionLevel = permissionLevel;
|
|
}
|
|
|
|
[CmifCommand(0)]
|
|
public Result CreateFriendService(out IFriendService friendService)
|
|
{
|
|
friendService = new FriendService(_accountManager, _permissionLevel);
|
|
|
|
return Result.Success;
|
|
}
|
|
|
|
[CmifCommand(1)] // 2.0.0+
|
|
public Result CreateNotificationService(out INotificationService notificationService, Uid userId)
|
|
{
|
|
if (userId.IsNull)
|
|
{
|
|
notificationService = null;
|
|
|
|
return FriendResult.InvalidArgument;
|
|
}
|
|
|
|
notificationService = new NotificationService(_notificationEventHandler, userId, _permissionLevel);
|
|
|
|
return Result.Success;
|
|
}
|
|
|
|
[CmifCommand(2)] // 4.0.0+
|
|
public Result CreateDaemonSuspendSessionService(out IDaemonSuspendSessionService daemonSuspendSessionService)
|
|
{
|
|
daemonSuspendSessionService = new DaemonSuspendSessionService();
|
|
|
|
return Result.Success;
|
|
}
|
|
}
|
|
}
|