aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/NotificationEventHandler.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2024-01-29 18:45:40 -0300
committerGitHub <noreply@github.com>2024-01-29 22:45:40 +0100
commit4117c13377b51b83ff87b1d00393be1a5ab5bfff (patch)
treec59181e229947070b76c20d88e7b9cbba314a4e9 /src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/NotificationEventHandler.cs
parent20a392ad552ce5cdbff1cb74f1d26d2f797cca31 (diff)
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
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/NotificationEventHandler.cs')
-rw-r--r--src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/NotificationEventHandler.cs74
1 files changed, 0 insertions, 74 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/NotificationEventHandler.cs b/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/NotificationEventHandler.cs
deleted file mode 100644
index 88627fd7..00000000
--- a/src/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/NotificationService/NotificationEventHandler.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using Ryujinx.HLE.HOS.Services.Account.Acc;
-
-namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator.NotificationService
-{
- public sealed class NotificationEventHandler
- {
- private static NotificationEventHandler _instance;
- private static readonly object _instanceLock = new();
-
- private readonly INotificationService[] _registry;
-
- public static NotificationEventHandler Instance
- {
- get
- {
- lock (_instanceLock)
- {
- _instance ??= new NotificationEventHandler();
-
- return _instance;
- }
- }
- }
-
- NotificationEventHandler()
- {
- _registry = new INotificationService[0x20];
- }
-
- internal void RegisterNotificationService(INotificationService service)
- {
- // NOTE: in case there isn't space anymore 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;
- }
- }
- }
-
- internal void UnregisterNotificationService(INotificationService service)
- {
- // NOTE: in case there isn't the entry 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 will have enough things to go online.
- public void SignalFriendListUpdate(UserId targetId)
- {
- for (int i = 0; i < _registry.Length; i++)
- {
- _registry[i]?.SignalFriendListUpdate(targetId);
- }
- }
-
- // TODO: Use this when we will have enough things to go online.
- public void SignalNewFriendRequest(UserId targetId)
- {
- for (int i = 0; i < _registry.Length; i++)
- {
- _registry[i]?.SignalNewFriendRequest(targetId);
- }
- }
- }
-}