mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-11 00:18:57 +02: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:
@@ -0,0 +1,8 @@
|
||||
namespace Ryujinx.Horizon.Sdk.Account
|
||||
{
|
||||
public interface IEmulatorAccountManager
|
||||
{
|
||||
void OpenUserOnlinePlay(Uid userId);
|
||||
void CloseUserOnlinePlay(Uid userId);
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user