mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-06-28 20:20:48 -07:00
Migrate friends service to new IPC (#6174)
* 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
This commit is contained in:
49
src/Ryujinx.Horizon/Friends/FriendsIpcServer.cs
Normal file
49
src/Ryujinx.Horizon/Friends/FriendsIpcServer.cs
Normal file
@ -0,0 +1,49 @@
|
||||
using Ryujinx.Horizon.Sdk.Sf.Hipc;
|
||||
using Ryujinx.Horizon.Sdk.Sm;
|
||||
|
||||
namespace Ryujinx.Horizon.Friends
|
||||
{
|
||||
class FriendsIpcServer
|
||||
{
|
||||
private const int MaxSessionsCount = 8;
|
||||
private const int TotalMaxSessionsCount = MaxSessionsCount * 5;
|
||||
|
||||
private const int PointerBufferSize = 0xA00;
|
||||
private const int MaxDomains = 64;
|
||||
private const int MaxDomainObjects = 16;
|
||||
private const int MaxPortsCount = 5;
|
||||
|
||||
private static readonly ManagerOptions _managerOptions = new(PointerBufferSize, MaxDomains, MaxDomainObjects, false);
|
||||
|
||||
private SmApi _sm;
|
||||
private FriendsServerManager _serverManager;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
HeapAllocator allocator = new();
|
||||
|
||||
_sm = new SmApi();
|
||||
_sm.Initialize().AbortOnFailure();
|
||||
|
||||
_serverManager = new FriendsServerManager(allocator, _sm, MaxPortsCount, _managerOptions, TotalMaxSessionsCount);
|
||||
|
||||
#pragma warning disable IDE0055 // Disable formatting
|
||||
_serverManager.RegisterServer((int)FriendsPortIndex.Admin, ServiceName.Encode("friend:a"), MaxSessionsCount);
|
||||
_serverManager.RegisterServer((int)FriendsPortIndex.User, ServiceName.Encode("friend:u"), MaxSessionsCount);
|
||||
_serverManager.RegisterServer((int)FriendsPortIndex.Viewer, ServiceName.Encode("friend:v"), MaxSessionsCount);
|
||||
_serverManager.RegisterServer((int)FriendsPortIndex.Manager, ServiceName.Encode("friend:m"), MaxSessionsCount);
|
||||
_serverManager.RegisterServer((int)FriendsPortIndex.System, ServiceName.Encode("friend:s"), MaxSessionsCount);
|
||||
#pragma warning restore IDE0055
|
||||
}
|
||||
|
||||
public void ServiceRequests()
|
||||
{
|
||||
_serverManager.ServiceRequests();
|
||||
}
|
||||
|
||||
public void Shutdown()
|
||||
{
|
||||
_serverManager.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
17
src/Ryujinx.Horizon/Friends/FriendsMain.cs
Normal file
17
src/Ryujinx.Horizon/Friends/FriendsMain.cs
Normal file
@ -0,0 +1,17 @@
|
||||
namespace Ryujinx.Horizon.Friends
|
||||
{
|
||||
class FriendsMain : IService
|
||||
{
|
||||
public static void Main(ServiceTable serviceTable)
|
||||
{
|
||||
FriendsIpcServer ipcServer = new();
|
||||
|
||||
ipcServer.Initialize();
|
||||
|
||||
serviceTable.SignalServiceReady();
|
||||
|
||||
ipcServer.ServiceRequests();
|
||||
ipcServer.Shutdown();
|
||||
}
|
||||
}
|
||||
}
|
11
src/Ryujinx.Horizon/Friends/FriendsPortIndex.cs
Normal file
11
src/Ryujinx.Horizon/Friends/FriendsPortIndex.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace Ryujinx.Horizon.Friends
|
||||
{
|
||||
enum FriendsPortIndex
|
||||
{
|
||||
Admin,
|
||||
User,
|
||||
Viewer,
|
||||
Manager,
|
||||
System,
|
||||
}
|
||||
}
|
36
src/Ryujinx.Horizon/Friends/FriendsServerManager.cs
Normal file
36
src/Ryujinx.Horizon/Friends/FriendsServerManager.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using Ryujinx.Horizon.Common;
|
||||
using Ryujinx.Horizon.Sdk.Account;
|
||||
using Ryujinx.Horizon.Sdk.Friends.Detail.Ipc;
|
||||
using Ryujinx.Horizon.Sdk.Sf.Hipc;
|
||||
using Ryujinx.Horizon.Sdk.Sm;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Horizon.Friends
|
||||
{
|
||||
class FriendsServerManager : ServerManager
|
||||
{
|
||||
private readonly IEmulatorAccountManager _accountManager;
|
||||
private readonly NotificationEventHandler _notificationEventHandler;
|
||||
|
||||
public FriendsServerManager(HeapAllocator allocator, SmApi sm, int maxPorts, ManagerOptions options, int maxSessions) : base(allocator, sm, maxPorts, options, maxSessions)
|
||||
{
|
||||
_accountManager = HorizonStatic.Options.AccountManager;
|
||||
_notificationEventHandler = new();
|
||||
}
|
||||
|
||||
protected override Result OnNeedsToAccept(int portIndex, Server server)
|
||||
{
|
||||
return (FriendsPortIndex)portIndex switch
|
||||
{
|
||||
#pragma warning disable IDE0055 // Disable formatting
|
||||
FriendsPortIndex.Admin => AcceptImpl(server, new ServiceCreator(_accountManager, _notificationEventHandler, FriendsServicePermissionLevel.Admin)),
|
||||
FriendsPortIndex.User => AcceptImpl(server, new ServiceCreator(_accountManager, _notificationEventHandler, FriendsServicePermissionLevel.User)),
|
||||
FriendsPortIndex.Viewer => AcceptImpl(server, new ServiceCreator(_accountManager, _notificationEventHandler, FriendsServicePermissionLevel.Viewer)),
|
||||
FriendsPortIndex.Manager => AcceptImpl(server, new ServiceCreator(_accountManager, _notificationEventHandler, FriendsServicePermissionLevel.Manager)),
|
||||
FriendsPortIndex.System => AcceptImpl(server, new ServiceCreator(_accountManager, _notificationEventHandler, FriendsServicePermissionLevel.System)),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(portIndex)),
|
||||
#pragma warning restore IDE0055
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using LibHac;
|
||||
using Ryujinx.Horizon.Sdk.Account;
|
||||
using Ryujinx.Horizon.Sdk.Fs;
|
||||
|
||||
namespace Ryujinx.Horizon
|
||||
@ -10,13 +11,15 @@ namespace Ryujinx.Horizon
|
||||
|
||||
public HorizonClient BcatClient { get; }
|
||||
public IFsClient FsClient { get; }
|
||||
public IEmulatorAccountManager AccountManager { get; }
|
||||
|
||||
public HorizonOptions(bool ignoreMissingServices, HorizonClient bcatClient, IFsClient fsClient)
|
||||
public HorizonOptions(bool ignoreMissingServices, HorizonClient bcatClient, IFsClient fsClient, IEmulatorAccountManager accountManager)
|
||||
{
|
||||
IgnoreMissingServices = ignoreMissingServices;
|
||||
ThrowOnInvalidCommandIds = true;
|
||||
BcatClient = bcatClient;
|
||||
FsClient = fsClient;
|
||||
AccountManager = accountManager;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,8 @@
|
||||
namespace Ryujinx.Horizon.Sdk.Account
|
||||
{
|
||||
public interface IEmulatorAccountManager
|
||||
{
|
||||
void OpenUserOnlinePlay(Uid userId);
|
||||
void CloseUserOnlinePlay(Uid userId);
|
||||
}
|
||||
}
|
20
src/Ryujinx.Horizon/Sdk/Account/NetworkServiceAccountId.cs
Normal file
20
src/Ryujinx.Horizon/Sdk/Account/NetworkServiceAccountId.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Account
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x8, Pack = 0x8)]
|
||||
readonly record struct NetworkServiceAccountId
|
||||
{
|
||||
public readonly ulong Id;
|
||||
|
||||
public NetworkServiceAccountId(ulong id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public override readonly string ToString()
|
||||
{
|
||||
return Id.ToString("x16");
|
||||
}
|
||||
}
|
||||
}
|
29
src/Ryujinx.Horizon/Sdk/Account/Nickname.cs
Normal file
29
src/Ryujinx.Horizon/Sdk/Account/Nickname.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Ryujinx.Common.Memory;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Account
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x21, Pack = 0x1)]
|
||||
readonly struct Nickname
|
||||
{
|
||||
public readonly Array33<byte> Name;
|
||||
|
||||
public Nickname(in Array33<byte> name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
int length = ((ReadOnlySpan<byte>)Name.AsSpan()).IndexOf((byte)0);
|
||||
if (length < 0)
|
||||
{
|
||||
length = 33;
|
||||
}
|
||||
|
||||
return Encoding.UTF8.GetString(Name.AsSpan()[..length]);
|
||||
}
|
||||
}
|
||||
}
|
@ -6,16 +6,16 @@ using System.Runtime.InteropServices;
|
||||
namespace Ryujinx.Horizon.Sdk.Account
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
readonly record struct Uid
|
||||
public readonly record struct Uid
|
||||
{
|
||||
public readonly long High;
|
||||
public readonly long Low;
|
||||
public readonly ulong High;
|
||||
public readonly ulong Low;
|
||||
|
||||
public bool IsNull => (Low | High) == 0;
|
||||
|
||||
public static Uid Null => new(0, 0);
|
||||
|
||||
public Uid(long low, long high)
|
||||
public Uid(ulong low, ulong high)
|
||||
{
|
||||
Low = low;
|
||||
High = high;
|
||||
@ -23,8 +23,8 @@ namespace Ryujinx.Horizon.Sdk.Account
|
||||
|
||||
public Uid(byte[] bytes)
|
||||
{
|
||||
High = BitConverter.ToInt64(bytes, 0);
|
||||
Low = BitConverter.ToInt64(bytes, 8);
|
||||
High = BitConverter.ToUInt64(bytes, 0);
|
||||
Low = BitConverter.ToUInt64(bytes, 8);
|
||||
}
|
||||
|
||||
public Uid(string hex)
|
||||
@ -34,8 +34,8 @@ namespace Ryujinx.Horizon.Sdk.Account
|
||||
throw new ArgumentException("Invalid Hex value!", nameof(hex));
|
||||
}
|
||||
|
||||
Low = Convert.ToInt64(hex[16..], 16);
|
||||
High = Convert.ToInt64(hex[..16], 16);
|
||||
Low = Convert.ToUInt64(hex[16..], 16);
|
||||
High = Convert.ToUInt64(hex[..16], 16);
|
||||
}
|
||||
|
||||
public void Write(BinaryWriter binaryWriter)
|
||||
|
12
src/Ryujinx.Horizon/Sdk/Friends/ApplicationInfo.cs
Normal file
12
src/Ryujinx.Horizon/Sdk/Friends/ApplicationInfo.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using Ryujinx.Horizon.Sdk.Ncm;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 0x8)]
|
||||
struct ApplicationInfo
|
||||
{
|
||||
public ApplicationId ApplicationId;
|
||||
public ulong PresenceGroupId;
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
struct BlockedUserImpl
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
struct FriendCandidateImpl
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x800)]
|
||||
struct FriendDetailedInfoImpl
|
||||
{
|
||||
}
|
||||
}
|
19
src/Ryujinx.Horizon/Sdk/Friends/Detail/FriendImpl.cs
Normal file
19
src/Ryujinx.Horizon/Sdk/Friends/Detail/FriendImpl.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Horizon.Sdk.Account;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x200, Pack = 0x8)]
|
||||
struct FriendImpl
|
||||
{
|
||||
public Uid UserId;
|
||||
public NetworkServiceAccountId NetworkUserId;
|
||||
public Nickname Nickname;
|
||||
public UserPresenceImpl Presence;
|
||||
public bool IsFavourite;
|
||||
public bool IsNew;
|
||||
public Array6<byte> Unknown;
|
||||
public bool IsValid;
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
struct FriendInvitationForViewerImpl
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x1400)]
|
||||
struct FriendInvitationGroupImpl
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
struct FriendRequestImpl
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x40)]
|
||||
struct FriendSettingImpl
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
partial class DaemonSuspendSessionService : IDaemonSuspendSessionService
|
||||
{
|
||||
// NOTE: This service has no commands.
|
||||
}
|
||||
}
|
1015
src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/FriendService.cs
Normal file
1015
src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/FriendService.cs
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,16 @@
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
enum FriendsServicePermissionLevel
|
||||
{
|
||||
UserMask = 1,
|
||||
ViewerMask = 2,
|
||||
ManagerMask = 4,
|
||||
SystemMask = 8,
|
||||
|
||||
Admin = -1,
|
||||
User = UserMask,
|
||||
Viewer = UserMask | ViewerMask,
|
||||
Manager = UserMask | ViewerMask | ManagerMask,
|
||||
System = UserMask | SystemMask,
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using Ryujinx.Horizon.Sdk.Sf;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
interface IDaemonSuspendSessionService : IServiceObject
|
||||
{
|
||||
// NOTE: This service has no commands.
|
||||
}
|
||||
}
|
97
src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/IFriendService.cs
Normal file
97
src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/IFriendService.cs
Normal file
@ -0,0 +1,97 @@
|
||||
using Ryujinx.Horizon.Common;
|
||||
using Ryujinx.Horizon.Sdk.Account;
|
||||
using Ryujinx.Horizon.Sdk.Settings;
|
||||
using Ryujinx.Horizon.Sdk.Sf;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
interface IFriendService : IServiceObject
|
||||
{
|
||||
Result GetCompletionEvent(out int completionEventHandle);
|
||||
Result Cancel();
|
||||
Result GetFriendListIds(out int count, Span<NetworkServiceAccountId> friendIds, Uid userId, int offset, SizedFriendFilter filter, ulong pidPlaceholder, ulong pid);
|
||||
Result GetFriendList(out int count, Span<FriendImpl> friendList, Uid userId, int offset, SizedFriendFilter filter, ulong pidPlaceholder, ulong pid);
|
||||
Result UpdateFriendInfo(Span<FriendImpl> info, Uid userId, ReadOnlySpan<NetworkServiceAccountId> friendIds, ulong pidPlaceholder, ulong pid);
|
||||
Result GetFriendProfileImage(out int size, Uid userId, NetworkServiceAccountId friendId, Span<byte> profileImage);
|
||||
Result CheckFriendListAvailability(out bool listAvailable, Uid userId);
|
||||
Result EnsureFriendListAvailable(Uid userId);
|
||||
Result SendFriendRequestForApplication(Uid userId, NetworkServiceAccountId friendId, in InAppScreenName arg2, in InAppScreenName arg3, ulong pidPlaceholder, ulong pid);
|
||||
Result AddFacedFriendRequestForApplication(Uid userId, FacedFriendRequestRegistrationKey key, Nickname nickname, ReadOnlySpan<byte> arg3, in InAppScreenName arg4, in InAppScreenName arg5, ulong pidPlaceholder, ulong pid);
|
||||
Result GetBlockedUserListIds(out int count, Span<NetworkServiceAccountId> blockedIds, Uid userId, int offset);
|
||||
Result CheckBlockedUserListAvailability(out bool listAvailable, Uid userId);
|
||||
Result EnsureBlockedUserListAvailable(Uid userId);
|
||||
Result GetProfileList(Span<ProfileImpl> profileList, Uid userId, ReadOnlySpan<NetworkServiceAccountId> friendIds);
|
||||
Result DeclareOpenOnlinePlaySession(Uid userId);
|
||||
Result DeclareCloseOnlinePlaySession(Uid userId);
|
||||
Result UpdateUserPresence(Uid userId, in UserPresenceImpl userPresence, ulong pidPlaceholder, ulong pid);
|
||||
Result GetPlayHistoryRegistrationKey(out PlayHistoryRegistrationKey registrationKey, Uid userId, bool arg2);
|
||||
Result GetPlayHistoryRegistrationKeyWithNetworkServiceAccountId(out PlayHistoryRegistrationKey registrationKey, NetworkServiceAccountId friendId, bool arg2);
|
||||
Result AddPlayHistory(Uid userId, in PlayHistoryRegistrationKey registrationKey, in InAppScreenName arg2, in InAppScreenName arg3, ulong pidPlaceholder, ulong pid);
|
||||
Result GetProfileImageUrl(out Url imageUrl, Url url, int arg2);
|
||||
Result GetFriendCount(out int count, Uid userId, SizedFriendFilter filter, ulong pidPlaceholder, ulong pid);
|
||||
Result GetNewlyFriendCount(out int count, Uid userId);
|
||||
Result GetFriendDetailedInfo(out FriendDetailedInfoImpl detailedInfo, Uid userId, NetworkServiceAccountId friendId);
|
||||
Result SyncFriendList(Uid userId);
|
||||
Result RequestSyncFriendList(Uid userId);
|
||||
Result LoadFriendSetting(out FriendSettingImpl friendSetting, Uid userId, NetworkServiceAccountId friendId);
|
||||
Result GetReceivedFriendRequestCount(out int count, out int count2, Uid userId);
|
||||
Result GetFriendRequestList(out int count, Span<FriendRequestImpl> requestList, Uid userId, int arg3, int arg4);
|
||||
Result GetFriendCandidateList(out int count, Span<FriendCandidateImpl> candidateList, Uid userId, int arg3);
|
||||
Result GetNintendoNetworkIdInfo(out NintendoNetworkIdUserInfo networkIdInfo, out int arg1, Span<NintendoNetworkIdFriendImpl> friendInfo, Uid userId, int arg4);
|
||||
Result GetSnsAccountLinkage(out SnsAccountLinkage accountLinkage, Uid userId);
|
||||
Result GetSnsAccountProfile(out SnsAccountProfile accountProfile, Uid userId, NetworkServiceAccountId friendId, int arg3);
|
||||
Result GetSnsAccountFriendList(out int count, Span<SnsAccountFriendImpl> friendList, Uid userId, int arg3);
|
||||
Result GetBlockedUserList(out int count, Span<BlockedUserImpl> blockedUsers, Uid userId, int arg3);
|
||||
Result SyncBlockedUserList(Uid userId);
|
||||
Result GetProfileExtraList(Span<ProfileExtraImpl> extraList, Uid userId, ReadOnlySpan<NetworkServiceAccountId> friendIds);
|
||||
Result GetRelationship(out Relationship relationship, Uid userId, NetworkServiceAccountId friendId);
|
||||
Result GetUserPresenceView(out UserPresenceViewImpl userPresenceView, Uid userId);
|
||||
Result GetPlayHistoryList(out int count, Span<PlayHistoryImpl> playHistoryList, Uid userId, int arg3);
|
||||
Result GetPlayHistoryStatistics(out PlayHistoryStatistics statistics, Uid userId);
|
||||
Result LoadUserSetting(out UserSettingImpl userSetting, Uid userId);
|
||||
Result SyncUserSetting(Uid userId);
|
||||
Result RequestListSummaryOverlayNotification();
|
||||
Result GetExternalApplicationCatalog(out ExternalApplicationCatalog catalog, ExternalApplicationCatalogId catalogId, LanguageCode language);
|
||||
Result GetReceivedFriendInvitationList(out int count, Span<FriendInvitationForViewerImpl> invitationList, Uid userId);
|
||||
Result GetReceivedFriendInvitationDetailedInfo(out FriendInvitationGroupImpl invicationGroup, Uid userId, FriendInvitationGroupId groupId);
|
||||
Result GetReceivedFriendInvitationCountCache(out int count, Uid userId);
|
||||
Result DropFriendNewlyFlags(Uid userId);
|
||||
Result DeleteFriend(Uid userId, NetworkServiceAccountId friendId);
|
||||
Result DropFriendNewlyFlag(Uid userId, NetworkServiceAccountId friendId);
|
||||
Result ChangeFriendFavoriteFlag(Uid userId, NetworkServiceAccountId friendId, bool favoriteFlag);
|
||||
Result ChangeFriendOnlineNotificationFlag(Uid userId, NetworkServiceAccountId friendId, bool onlineNotificationFlag);
|
||||
Result SendFriendRequest(Uid userId, NetworkServiceAccountId friendId, int arg2);
|
||||
Result SendFriendRequestWithApplicationInfo(Uid userId, NetworkServiceAccountId friendId, int arg2, ApplicationInfo applicationInfo, in InAppScreenName arg4, in InAppScreenName arg5);
|
||||
Result CancelFriendRequest(Uid userId, RequestId requestId);
|
||||
Result AcceptFriendRequest(Uid userId, RequestId requestId);
|
||||
Result RejectFriendRequest(Uid userId, RequestId requestId);
|
||||
Result ReadFriendRequest(Uid userId, RequestId requestId);
|
||||
Result GetFacedFriendRequestRegistrationKey(out FacedFriendRequestRegistrationKey registrationKey, Uid userId);
|
||||
Result AddFacedFriendRequest(Uid userId, FacedFriendRequestRegistrationKey registrationKey, Nickname nickname, ReadOnlySpan<byte> arg3);
|
||||
Result CancelFacedFriendRequest(Uid userId, NetworkServiceAccountId friendId);
|
||||
Result GetFacedFriendRequestProfileImage(out int size, Uid userId, NetworkServiceAccountId friendId, Span<byte> profileImage);
|
||||
Result GetFacedFriendRequestProfileImageFromPath(out int size, ReadOnlySpan<byte> path, Span<byte> profileImage);
|
||||
Result SendFriendRequestWithExternalApplicationCatalogId(Uid userId, NetworkServiceAccountId friendId, int arg2, ExternalApplicationCatalogId catalogId, in InAppScreenName arg4, in InAppScreenName arg5);
|
||||
Result ResendFacedFriendRequest(Uid userId, NetworkServiceAccountId friendId);
|
||||
Result SendFriendRequestWithNintendoNetworkIdInfo(Uid userId, NetworkServiceAccountId friendId, int arg2, MiiName arg3, MiiImageUrlParam arg4, MiiName arg5, MiiImageUrlParam arg6);
|
||||
Result GetSnsAccountLinkPageUrl(out WebPageUrl url, Uid userId, int arg2);
|
||||
Result UnlinkSnsAccount(Uid userId, int arg1);
|
||||
Result BlockUser(Uid userId, NetworkServiceAccountId friendId, int arg2);
|
||||
Result BlockUserWithApplicationInfo(Uid userId, NetworkServiceAccountId friendId, int arg2, ApplicationInfo applicationInfo, in InAppScreenName arg4);
|
||||
Result UnblockUser(Uid userId, NetworkServiceAccountId friendId);
|
||||
Result GetProfileExtraFromFriendCode(out ProfileExtraImpl profileExtra, Uid userId, FriendCode friendCode);
|
||||
Result DeletePlayHistory(Uid userId);
|
||||
Result ChangePresencePermission(Uid userId, int permission);
|
||||
Result ChangeFriendRequestReception(Uid userId, bool reception);
|
||||
Result ChangePlayLogPermission(Uid userId, int permission);
|
||||
Result IssueFriendCode(Uid userId);
|
||||
Result ClearPlayLog(Uid userId);
|
||||
Result SendFriendInvitation(Uid userId, ReadOnlySpan<NetworkServiceAccountId> friendIds, in FriendInvitationGameModeDescription description, ApplicationInfo applicationInfo, ReadOnlySpan<byte> arg4, bool arg5);
|
||||
Result ReadFriendInvitation(Uid userId, ReadOnlySpan<FriendInvitationId> invitationIds);
|
||||
Result ReadAllFriendInvitations(Uid userId);
|
||||
Result DeleteFriendListCache(Uid userId);
|
||||
Result DeleteBlockedUserListCache(Uid userId);
|
||||
Result DeleteNetworkServiceAccountCache(Uid userId);
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using Ryujinx.Horizon.Common;
|
||||
using Ryujinx.Horizon.Sdk.Sf;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
interface INotificationService : IServiceObject
|
||||
{
|
||||
Result GetEvent(out int eventHandle);
|
||||
Result Clear();
|
||||
Result Pop(out SizedNotificationInfo sizedNotificationInfo);
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using Ryujinx.Horizon.Common;
|
||||
using Ryujinx.Horizon.Sdk.Account;
|
||||
using Ryujinx.Horizon.Sdk.Sf;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
interface IServiceCreator : IServiceObject
|
||||
{
|
||||
Result CreateFriendService(out IFriendService friendService);
|
||||
Result CreateNotificationService(out INotificationService notificationService, Uid userId);
|
||||
Result CreateDaemonSuspendSessionService(out IDaemonSuspendSessionService daemonSuspendSessionService);
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
using Ryujinx.Horizon.Sdk.Account;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
sealed class NotificationEventHandler
|
||||
{
|
||||
private readonly NotificationService[] _registry;
|
||||
|
||||
public NotificationEventHandler()
|
||||
{
|
||||
_registry = new NotificationService[0x20];
|
||||
}
|
||||
|
||||
public void RegisterNotificationService(NotificationService service)
|
||||
{
|
||||
// NOTE: When there's no enough space in the registry array, Nintendo doesn't return any errors.
|
||||
for (int i = 0; i < _registry.Length; i++)
|
||||
{
|
||||
if (_registry[i] == null)
|
||||
{
|
||||
_registry[i] = service;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void UnregisterNotificationService(NotificationService service)
|
||||
{
|
||||
// NOTE: When there's no enough space in the registry array, Nintendo doesn't return any errors.
|
||||
for (int i = 0; i < _registry.Length; i++)
|
||||
{
|
||||
if (_registry[i] == service)
|
||||
{
|
||||
_registry[i] = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Use this when we have enough things to go online.
|
||||
public void SignalFriendListUpdate(Uid targetId)
|
||||
{
|
||||
for (int i = 0; i < _registry.Length; i++)
|
||||
{
|
||||
_registry[i]?.SignalFriendListUpdate(targetId);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Use this when we have enough things to go online.
|
||||
public void SignalNewFriendRequest(Uid targetId)
|
||||
{
|
||||
for (int i = 0; i < _registry.Length; i++)
|
||||
{
|
||||
_registry[i]?.SignalNewFriendRequest(targetId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
enum NotificationEventType : uint
|
||||
{
|
||||
Invalid = 0x0,
|
||||
FriendListUpdate = 0x1,
|
||||
NewFriendRequest = 0x65,
|
||||
}
|
||||
}
|
@ -0,0 +1,172 @@
|
||||
using Ryujinx.Horizon.Common;
|
||||
using Ryujinx.Horizon.Sdk.Account;
|
||||
using Ryujinx.Horizon.Sdk.OsTypes;
|
||||
using Ryujinx.Horizon.Sdk.Sf;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
partial class NotificationService : INotificationService, IDisposable
|
||||
{
|
||||
private readonly NotificationEventHandler _notificationEventHandler;
|
||||
private readonly Uid _userId;
|
||||
private readonly FriendsServicePermissionLevel _permissionLevel;
|
||||
|
||||
private readonly object _lock = new();
|
||||
|
||||
private SystemEventType _notificationEvent;
|
||||
|
||||
private readonly LinkedList<SizedNotificationInfo> _notifications;
|
||||
|
||||
private bool _hasNewFriendRequest;
|
||||
private bool _hasFriendListUpdate;
|
||||
|
||||
public NotificationService(NotificationEventHandler notificationEventHandler, Uid userId, FriendsServicePermissionLevel permissionLevel)
|
||||
{
|
||||
_notificationEventHandler = notificationEventHandler;
|
||||
_userId = userId;
|
||||
_permissionLevel = permissionLevel;
|
||||
_notifications = new LinkedList<SizedNotificationInfo>();
|
||||
Os.CreateSystemEvent(out _notificationEvent, EventClearMode.AutoClear, interProcess: true).AbortOnFailure();
|
||||
|
||||
_hasNewFriendRequest = false;
|
||||
_hasFriendListUpdate = false;
|
||||
|
||||
notificationEventHandler.RegisterNotificationService(this);
|
||||
}
|
||||
|
||||
[CmifCommand(0)]
|
||||
public Result GetEvent([CopyHandle] out int eventHandle)
|
||||
{
|
||||
eventHandle = Os.GetReadableHandleOfSystemEvent(ref _notificationEvent);
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
[CmifCommand(1)]
|
||||
public Result Clear()
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
_hasNewFriendRequest = false;
|
||||
_hasFriendListUpdate = false;
|
||||
|
||||
_notifications.Clear();
|
||||
}
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
|
||||
[CmifCommand(2)]
|
||||
public Result Pop(out SizedNotificationInfo sizedNotificationInfo)
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
if (_notifications.Count >= 1)
|
||||
{
|
||||
sizedNotificationInfo = _notifications.First.Value;
|
||||
_notifications.RemoveFirst();
|
||||
|
||||
if (sizedNotificationInfo.Type == NotificationEventType.FriendListUpdate)
|
||||
{
|
||||
_hasFriendListUpdate = false;
|
||||
}
|
||||
else if (sizedNotificationInfo.Type == NotificationEventType.NewFriendRequest)
|
||||
{
|
||||
_hasNewFriendRequest = false;
|
||||
}
|
||||
|
||||
return Result.Success;
|
||||
}
|
||||
}
|
||||
|
||||
sizedNotificationInfo = default;
|
||||
|
||||
return FriendResult.NotificationQueueEmpty;
|
||||
}
|
||||
|
||||
public void SignalFriendListUpdate(Uid targetId)
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
if (_userId == targetId)
|
||||
{
|
||||
if (!_hasFriendListUpdate)
|
||||
{
|
||||
SizedNotificationInfo friendListNotification = new();
|
||||
|
||||
if (_notifications.Count != 0)
|
||||
{
|
||||
friendListNotification = _notifications.First.Value;
|
||||
_notifications.RemoveFirst();
|
||||
}
|
||||
|
||||
friendListNotification.Type = NotificationEventType.FriendListUpdate;
|
||||
_hasFriendListUpdate = true;
|
||||
|
||||
if (_hasNewFriendRequest)
|
||||
{
|
||||
SizedNotificationInfo newFriendRequestNotification = new();
|
||||
|
||||
if (_notifications.Count != 0)
|
||||
{
|
||||
newFriendRequestNotification = _notifications.First.Value;
|
||||
_notifications.RemoveFirst();
|
||||
}
|
||||
|
||||
newFriendRequestNotification.Type = NotificationEventType.NewFriendRequest;
|
||||
_notifications.AddFirst(newFriendRequestNotification);
|
||||
}
|
||||
|
||||
// We defer this to make sure we are on top of the queue.
|
||||
_notifications.AddFirst(friendListNotification);
|
||||
}
|
||||
|
||||
Os.SignalSystemEvent(ref _notificationEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SignalNewFriendRequest(Uid targetId)
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
if (_permissionLevel.HasFlag(FriendsServicePermissionLevel.ViewerMask) && _userId == targetId)
|
||||
{
|
||||
if (!_hasNewFriendRequest)
|
||||
{
|
||||
if (_notifications.Count == 100)
|
||||
{
|
||||
SignalFriendListUpdate(targetId);
|
||||
}
|
||||
|
||||
SizedNotificationInfo newFriendRequestNotification = new()
|
||||
{
|
||||
Type = NotificationEventType.NewFriendRequest,
|
||||
};
|
||||
|
||||
_notifications.AddLast(newFriendRequestNotification);
|
||||
_hasNewFriendRequest = true;
|
||||
}
|
||||
|
||||
Os.SignalSystemEvent(ref _notificationEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
_notificationEventHandler.UnregisterNotificationService(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(disposing: true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
enum PresenceStatusFilter : uint
|
||||
{
|
||||
None,
|
||||
Online,
|
||||
OnlinePlay,
|
||||
OnlineOrOnlinePlay,
|
||||
}
|
||||
}
|
51
src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/ServiceCreator.cs
Normal file
51
src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/ServiceCreator.cs
Normal file
@ -0,0 +1,51 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 0x8)]
|
||||
struct SizedFriendFilter
|
||||
{
|
||||
public PresenceStatusFilter PresenceStatus;
|
||||
public bool IsFavoriteOnly;
|
||||
public bool IsSameAppPresenceOnly;
|
||||
public bool IsSameAppPlayedOnly;
|
||||
public bool IsArbitraryAppPlayedOnly;
|
||||
public ulong PresenceGroupId;
|
||||
|
||||
public readonly override string ToString()
|
||||
{
|
||||
return $"{{ PresenceStatus: {PresenceStatus}, " +
|
||||
$"IsFavoriteOnly: {IsFavoriteOnly}, " +
|
||||
$"IsSameAppPresenceOnly: {IsSameAppPresenceOnly}, " +
|
||||
$"IsSameAppPlayedOnly: {IsSameAppPlayedOnly}, " +
|
||||
$"IsArbitraryAppPlayedOnly: {IsArbitraryAppPlayedOnly}, " +
|
||||
$"PresenceGroupId: {PresenceGroupId} }}";
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using Ryujinx.Horizon.Sdk.Account;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 0x8)]
|
||||
struct SizedNotificationInfo
|
||||
{
|
||||
public NotificationEventType Type;
|
||||
public uint Padding;
|
||||
public NetworkServiceAccountId NetworkUserIdPlaceholder;
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
struct NintendoNetworkIdFriendImpl
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
struct PlayHistoryImpl
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Friends/Detail/PresenceStatus.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Friends/Detail/PresenceStatus.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
enum PresenceStatus : uint
|
||||
{
|
||||
Offline,
|
||||
Online,
|
||||
OnlinePlay,
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x400)]
|
||||
struct ProfileExtraImpl
|
||||
{
|
||||
}
|
||||
}
|
8
src/Ryujinx.Horizon/Sdk/Friends/Detail/ProfileImpl.cs
Normal file
8
src/Ryujinx.Horizon/Sdk/Friends/Detail/ProfileImpl.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
struct ProfileImpl
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
struct SnsAccountFriendImpl
|
||||
{
|
||||
}
|
||||
}
|
29
src/Ryujinx.Horizon/Sdk/Friends/Detail/UserPresenceImpl.cs
Normal file
29
src/Ryujinx.Horizon/Sdk/Friends/Detail/UserPresenceImpl.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Horizon.Sdk.Account;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0xE0)]
|
||||
struct UserPresenceImpl
|
||||
{
|
||||
public Uid UserId;
|
||||
public long LastTimeOnlineTimestamp;
|
||||
public PresenceStatus Status;
|
||||
public bool SamePresenceGroupApplication;
|
||||
public Array3<byte> Unknown;
|
||||
public AppKeyValueStorageHolder AppKeyValueStorage;
|
||||
|
||||
[InlineArray(0xC0)]
|
||||
public struct AppKeyValueStorageHolder
|
||||
{
|
||||
public byte Value;
|
||||
}
|
||||
|
||||
public readonly override string ToString()
|
||||
{
|
||||
return $"{{ UserId: {UserId}, LastTimeOnlineTimestamp: {LastTimeOnlineTimestamp}, Status: {Status} }}";
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0xE0)]
|
||||
struct UserPresenceViewImpl
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends.Detail
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x800)]
|
||||
struct UserSettingImpl
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x4B8)]
|
||||
struct ExternalApplicationCatalog
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 0x8)]
|
||||
struct ExternalApplicationCatalogId
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x40, Pack = 0x1)]
|
||||
struct FacedFriendRequestRegistrationKey
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Friends/FriendCode.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Friends/FriendCode.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x20, Pack = 0x1)]
|
||||
struct FriendCode
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0xC00)]
|
||||
struct FriendInvitationGameModeDescription
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x8, Pack = 0x8)]
|
||||
struct FriendInvitationGroupId
|
||||
{
|
||||
}
|
||||
}
|
8
src/Ryujinx.Horizon/Sdk/Friends/FriendInvitationId.cs
Normal file
8
src/Ryujinx.Horizon/Sdk/Friends/FriendInvitationId.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
struct FriendInvitationId
|
||||
{
|
||||
}
|
||||
}
|
13
src/Ryujinx.Horizon/Sdk/Friends/FriendResult.cs
Normal file
13
src/Ryujinx.Horizon/Sdk/Friends/FriendResult.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Ryujinx.Horizon.Common;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
static class FriendResult
|
||||
{
|
||||
private const int ModuleId = 121;
|
||||
|
||||
public static Result InvalidArgument => new(ModuleId, 2);
|
||||
public static Result InternetRequestDenied => new(ModuleId, 6);
|
||||
public static Result NotificationQueueEmpty => new(ModuleId, 15);
|
||||
}
|
||||
}
|
26
src/Ryujinx.Horizon/Sdk/Friends/InAppScreenName.cs
Normal file
26
src/Ryujinx.Horizon/Sdk/Friends/InAppScreenName.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Horizon.Sdk.Settings;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x48)]
|
||||
struct InAppScreenName
|
||||
{
|
||||
public Array64<byte> Name;
|
||||
public LanguageCode LanguageCode;
|
||||
|
||||
public override readonly string ToString()
|
||||
{
|
||||
int length = Name.AsSpan().IndexOf((byte)0);
|
||||
if (length < 0)
|
||||
{
|
||||
length = 64;
|
||||
}
|
||||
|
||||
return Encoding.UTF8.GetString(Name.AsSpan()[..length]);
|
||||
}
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Friends/MiiImageUrlParam.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Friends/MiiImageUrlParam.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 0x1)]
|
||||
struct MiiImageUrlParam
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Friends/MiiName.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Friends/MiiName.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x20, Pack = 0x1)]
|
||||
struct MiiName
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x38)]
|
||||
struct NintendoNetworkIdUserInfo
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Horizon.Sdk.Account;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x40)]
|
||||
struct PlayHistoryRegistrationKey
|
||||
{
|
||||
public ushort Type;
|
||||
public byte KeyIndex;
|
||||
public byte UserIdBool;
|
||||
public byte UnknownBool;
|
||||
public Array11<byte> Reserved;
|
||||
public Uid Uuid;
|
||||
public Array32<byte> HmacHash;
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Friends/PlayHistoryStatistics.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Friends/PlayHistoryStatistics.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 0x8)]
|
||||
struct PlayHistoryStatistics
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Friends/Relationship.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Friends/Relationship.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x8, Pack = 0x1)]
|
||||
struct Relationship
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Friends/RequestId.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Friends/RequestId.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x8, Pack = 0x8)]
|
||||
struct RequestId
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Friends/SnsAccountLinkage.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Friends/SnsAccountLinkage.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x8, Pack = 0x1)]
|
||||
struct SnsAccountLinkage
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Friends/SnsAccountProfile.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Friends/SnsAccountProfile.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x380)]
|
||||
struct SnsAccountProfile
|
||||
{
|
||||
}
|
||||
}
|
30
src/Ryujinx.Horizon/Sdk/Friends/Url.cs
Normal file
30
src/Ryujinx.Horizon/Sdk/Friends/Url.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0xA0, Pack = 0x1)]
|
||||
struct Url
|
||||
{
|
||||
public UrlStorage Path;
|
||||
|
||||
[InlineArray(0xA0)]
|
||||
public struct UrlStorage
|
||||
{
|
||||
public byte Value;
|
||||
}
|
||||
|
||||
public override readonly string ToString()
|
||||
{
|
||||
int length = ((ReadOnlySpan<byte>)Path).IndexOf((byte)0);
|
||||
if (length < 0)
|
||||
{
|
||||
length = 33;
|
||||
}
|
||||
|
||||
return Encoding.UTF8.GetString(((ReadOnlySpan<byte>)Path)[..length]);
|
||||
}
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Friends/WebPageUrl.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Friends/WebPageUrl.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Friends
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x1000)]
|
||||
struct WebPageUrl
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Settings/BatteryLot.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Settings/BatteryLot.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x18, Pack = 0x1)]
|
||||
struct BatteryLot
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x6, Pack = 0x2)]
|
||||
struct AccelerometerOffset
|
||||
{
|
||||
public ushort X;
|
||||
public ushort Y;
|
||||
public ushort Z;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x6, Pack = 0x2)]
|
||||
struct AccelerometerScale
|
||||
{
|
||||
public ushort X;
|
||||
public ushort Y;
|
||||
public ushort Z;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x74, Pack = 0x4)]
|
||||
struct AmiiboEcdsaCertificate
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x24, Pack = 0x4)]
|
||||
struct AmiiboEcqvBlsCertificate
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x48, Pack = 0x4)]
|
||||
struct AmiiboEcqvBlsKey
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x94, Pack = 0x4)]
|
||||
struct AmiiboEcqvBlsRootCertificate
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x18, Pack = 0x4)]
|
||||
struct AmiiboEcqvCertificate
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Settings/Factory/AmiiboKey.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Settings/Factory/AmiiboKey.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x58, Pack = 0x4)]
|
||||
struct AmiiboKey
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x9, Pack = 0x1)]
|
||||
struct AnalogStickFactoryCalibration
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x12, Pack = 0x1)]
|
||||
struct AnalogStickModelParameter
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Settings/Factory/BdAddress.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Settings/Factory/BdAddress.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x6, Pack = 0x1)]
|
||||
struct BdAddress
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x1E, Pack = 0x1)]
|
||||
struct ConfigurationId1
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x6, Pack = 0x2)]
|
||||
struct ConsoleSixAxisSensorHorizontalOffset
|
||||
{
|
||||
public ushort X;
|
||||
public ushort Y;
|
||||
public ushort Z;
|
||||
}
|
||||
}
|
8
src/Ryujinx.Horizon/Sdk/Settings/Factory/CountryCode.cs
Normal file
8
src/Ryujinx.Horizon/Sdk/Settings/Factory/CountryCode.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
struct CountryCode
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x180)]
|
||||
struct EccB233DeviceCertificate
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x58, Pack = 0x4)]
|
||||
struct EccB233DeviceKey
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x400)]
|
||||
struct GameCardCertificate
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Settings/Factory/GameCardKey.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Settings/Factory/GameCardKey.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x138)]
|
||||
struct GameCardKey
|
||||
{
|
||||
}
|
||||
}
|
12
src/Ryujinx.Horizon/Sdk/Settings/Factory/GyroscopeOffset.cs
Normal file
12
src/Ryujinx.Horizon/Sdk/Settings/Factory/GyroscopeOffset.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x6, Pack = 0x2)]
|
||||
struct GyroscopeOffset
|
||||
{
|
||||
public ushort X;
|
||||
public ushort Y;
|
||||
public ushort Z;
|
||||
}
|
||||
}
|
12
src/Ryujinx.Horizon/Sdk/Settings/Factory/GyroscopeScale.cs
Normal file
12
src/Ryujinx.Horizon/Sdk/Settings/Factory/GyroscopeScale.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x6, Pack = 0x2)]
|
||||
struct GyroscopeScale
|
||||
{
|
||||
public ushort X;
|
||||
public ushort Y;
|
||||
public ushort Z;
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Settings/Factory/MacAddress.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Settings/Factory/MacAddress.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x6, Pack = 0x1)]
|
||||
struct MacAddress
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x240)]
|
||||
struct Rsa2048DeviceCertificate
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x248)]
|
||||
struct Rsa2048DeviceKey
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Settings/Factory/SerialNumber.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Settings/Factory/SerialNumber.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x18, Pack = 0x1)]
|
||||
struct SerialNumber
|
||||
{
|
||||
}
|
||||
}
|
32
src/Ryujinx.Horizon/Sdk/Settings/Factory/SpeakerParameter.cs
Normal file
32
src/Ryujinx.Horizon/Sdk/Settings/Factory/SpeakerParameter.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using Ryujinx.Common.Memory;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x5A, Pack = 0x2)]
|
||||
struct SpeakerParameter
|
||||
{
|
||||
public ushort Version;
|
||||
public Array34<byte> Reserved;
|
||||
public ushort SpeakerHpf2A1;
|
||||
public ushort SpeakerHpf2A2;
|
||||
public ushort SpeakerHpf2H0;
|
||||
public ushort SpeakerEqInputVolume;
|
||||
public ushort SpeakerEqOutputVolume;
|
||||
public ushort SpeakerEqCtrl1;
|
||||
public ushort SpeakerEqCtrl2;
|
||||
public ushort SpeakerDrcAgcCtrl2;
|
||||
public ushort SpeakerDrcAgcCtrl3;
|
||||
public ushort SpeakerDrcAgcCtrl1;
|
||||
public ushort SpeakerAnalogVolume;
|
||||
public ushort HeadphoneAnalogVolume;
|
||||
public ushort SpeakerDigitalVolumeMin;
|
||||
public ushort SpeakerDigitalVolumeMax;
|
||||
public ushort HeadphoneDigitalVolumeMin;
|
||||
public ushort HeadphoneDigitalVolumeMax;
|
||||
public ushort MicFixedGain;
|
||||
public ushort MicVariableVolumeMin;
|
||||
public ushort MicVariableVolumeMax;
|
||||
public Array16<byte> Reserved2;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x804)]
|
||||
struct SslCertificate
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Settings/Factory/SslKey.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Settings/Factory/SslKey.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.Factory
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x138)]
|
||||
struct SslKey
|
||||
{
|
||||
}
|
||||
}
|
24
src/Ryujinx.Horizon/Sdk/Settings/Language.cs
Normal file
24
src/Ryujinx.Horizon/Sdk/Settings/Language.cs
Normal file
@ -0,0 +1,24 @@
|
||||
namespace Ryujinx.Horizon.Sdk.Settings
|
||||
{
|
||||
enum Language : uint
|
||||
{
|
||||
Japanese,
|
||||
AmericanEnglish,
|
||||
French,
|
||||
German,
|
||||
Italian,
|
||||
Spanish,
|
||||
Chinese,
|
||||
Korean,
|
||||
Dutch,
|
||||
Portuguese,
|
||||
Russian,
|
||||
Taiwanese,
|
||||
BritishEnglish,
|
||||
CanadianFrench,
|
||||
LatinAmericanSpanish,
|
||||
SimplifiedChinese,
|
||||
TraditionalChinese,
|
||||
BrazilianPortuguese,
|
||||
}
|
||||
}
|
63
src/Ryujinx.Horizon/Sdk/Settings/LanguageCode.cs
Normal file
63
src/Ryujinx.Horizon/Sdk/Settings/LanguageCode.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using Ryujinx.Common.Memory;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x8, Pack = 0x1)]
|
||||
struct LanguageCode
|
||||
{
|
||||
private static readonly string[] _languageCodes = new string[]
|
||||
{
|
||||
"ja",
|
||||
"en-US",
|
||||
"fr",
|
||||
"de",
|
||||
"it",
|
||||
"es",
|
||||
"zh-CN",
|
||||
"ko",
|
||||
"nl",
|
||||
"pt",
|
||||
"ru",
|
||||
"zh-TW",
|
||||
"en-GB",
|
||||
"fr-CA",
|
||||
"es-419",
|
||||
"zh-Hans",
|
||||
"zh-Hant",
|
||||
"pt-BR"
|
||||
};
|
||||
|
||||
public Array8<byte> Value;
|
||||
|
||||
public bool IsValid()
|
||||
{
|
||||
int length = Value.AsSpan().IndexOf((byte)0);
|
||||
if (length < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
string str = Encoding.ASCII.GetString(Value.AsSpan()[..length]);
|
||||
|
||||
return _languageCodes.AsSpan().Contains(str);
|
||||
}
|
||||
|
||||
public LanguageCode(Language language)
|
||||
{
|
||||
if ((uint)language >= _languageCodes.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(language));
|
||||
}
|
||||
|
||||
Value = new LanguageCode(_languageCodes[(int)language]).Value;
|
||||
}
|
||||
|
||||
public LanguageCode(string strCode)
|
||||
{
|
||||
Encoding.ASCII.GetBytes(strCode, Value.AsSpan());
|
||||
}
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Settings/SettingsItemKey.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Settings/SettingsItemKey.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x48)]
|
||||
struct SettingsItemKey
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Settings/SettingsName.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Settings/SettingsName.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x48)]
|
||||
struct SettingsName
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using Ryujinx.Horizon.Sdk.Account;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.System
|
||||
{
|
||||
struct AccountNotificationSettings
|
||||
{
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public Uid UserId;
|
||||
public uint Flags;
|
||||
public byte FriendPresenceOverlayPermission;
|
||||
public byte FriendInvitationOverlayPermission;
|
||||
public ushort Reserved;
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.System
|
||||
{
|
||||
struct AccountOnlineStorageSettings
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.System
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x4, Pack = 0x4)]
|
||||
struct AccountSettings
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.System
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x100)]
|
||||
struct AllowedSslHost
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.System
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 0x4)]
|
||||
struct AnalogStickUserCalibration
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.System
|
||||
{
|
||||
[Flags]
|
||||
enum AppletLaunchFlag : uint
|
||||
{
|
||||
}
|
||||
}
|
9
src/Ryujinx.Horizon/Sdk/Settings/System/AudioVolume.cs
Normal file
9
src/Ryujinx.Horizon/Sdk/Settings/System/AudioVolume.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.Horizon.Sdk.Settings.System
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x8, Pack = 0x4)]
|
||||
struct AudioVolume
|
||||
{
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user