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:
parent
20a392ad55
commit
4117c13377
148 changed files with 3026 additions and 832 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue