add Friend structure layout

This commit is contained in:
Thog 2019-06-27 15:59:51 +02:00
parent f7704e35d1
commit 5b80dce790
No known key found for this signature in database
GPG key ID: 0CD291558FAFDBC6
2 changed files with 31 additions and 3 deletions

View file

@ -138,7 +138,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend
return 0;
}
// nn::friends::GetFriendList(int offset, nn::account::Uid userUUID, nn::friends::detail::ipc::SizedFriendFilter friendFilter, ulong pidPlaceHolder, pid) -> int outCount, array<nn::account::NetworkServiceAccountId, 0x6>
// nn::friends::GetFriendList(int offset, nn::account::Uid userUUID, nn::friends::detail::ipc::SizedFriendFilter friendFilter, ulong pidPlaceHolder, pid) -> int outCount, array<nn::friends::detail::FriendImpl, 0x6>
public long GetFriendList(ServiceCtx context)
{
int offset = context.RequestData.ReadInt32();

View file

@ -38,14 +38,18 @@ namespace Ryujinx.HLE.HOS.Services.Friend
public long PresenceGroupId;
}
[StructLayout(LayoutKind.Sequential)]
[StructLayout(LayoutKind.Sequential, Pack = 0x8)]
struct UserPresence
{
public UInt128 UserId;
public long LastTimeOnlineTimestamp;
public PresenceStatus Status;
uint padding;
[MarshalAs(UnmanagedType.I1)]
public bool SamePresenceGroupApplication;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x3)]
char[] unknown;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xC0)]
public char[] AppKeyValueStorage;
@ -56,4 +60,28 @@ namespace Ryujinx.HLE.HOS.Services.Friend
return $"UserPresence {{ UserId: {UserId}, LastTimeOnlineTimestamp: {LastTimeOnlineTimestamp}, Status: {Status}, AppKeyValueStorage: {AppKeyValueStorage} }}";
}
}
[StructLayout(LayoutKind.Sequential, Pack = 0x8, Size = 0x200)]
struct Friend
{
public UInt128 UserId;
public long NetworkUserId;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x21)]
public char[] Nickname;
public UserPresence presence;
[MarshalAs(UnmanagedType.I1)]
public bool IsFavourite;
[MarshalAs(UnmanagedType.I1)]
public bool IsNew;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x6)]
char[] unknown;
[MarshalAs(UnmanagedType.I1)]
public bool IsValid;
}
}