aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Friend
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Friend')
-rw-r--r--Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs49
-rw-r--r--Ryujinx.HLE/HOS/Services/Friend/IServiceCreator.cs27
2 files changed, 76 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs b/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs
new file mode 100644
index 00000000..3b06ba8a
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs
@@ -0,0 +1,49 @@
+using Ryujinx.HLE.HOS.Ipc;
+using Ryujinx.HLE.HOS.SystemState;
+using Ryujinx.HLE.Logging;
+using System.Collections.Generic;
+
+namespace Ryujinx.HLE.HOS.Services.Friend
+{
+ class IFriendService : IpcService
+ {
+ private Dictionary<int, ServiceProcessRequest> m_Commands;
+
+ public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
+
+ public IFriendService()
+ {
+ m_Commands = new Dictionary<int, ServiceProcessRequest>()
+ {
+ { 10601, DeclareCloseOnlinePlaySession },
+ { 10610, UpdateUserPresence }
+ };
+ }
+
+ public long DeclareCloseOnlinePlaySession(ServiceCtx Context)
+ {
+ UserId Uuid = new UserId(
+ Context.RequestData.ReadInt64(),
+ Context.RequestData.ReadInt64());
+
+ if (Context.Device.System.State.TryGetUser(Uuid, out UserProfile Profile))
+ {
+ Profile.OnlinePlayState = OpenCloseState.Closed;
+ }
+
+ return 0;
+ }
+
+ public long UpdateUserPresence(ServiceCtx Context)
+ {
+ UserId Uuid = new UserId(
+ Context.RequestData.ReadInt64(),
+ Context.RequestData.ReadInt64());
+
+ //TODO.
+ Context.Device.Log.PrintStub(LogClass.ServiceFriend, "Stubbed.");
+
+ return 0;
+ }
+ }
+} \ No newline at end of file
diff --git a/Ryujinx.HLE/HOS/Services/Friend/IServiceCreator.cs b/Ryujinx.HLE/HOS/Services/Friend/IServiceCreator.cs
new file mode 100644
index 00000000..065e230d
--- /dev/null
+++ b/Ryujinx.HLE/HOS/Services/Friend/IServiceCreator.cs
@@ -0,0 +1,27 @@
+using Ryujinx.HLE.HOS.Ipc;
+using System.Collections.Generic;
+
+namespace Ryujinx.HLE.HOS.Services.Friend
+{
+ class IServiceCreator : IpcService
+ {
+ private Dictionary<int, ServiceProcessRequest> m_Commands;
+
+ public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
+
+ public IServiceCreator()
+ {
+ m_Commands = new Dictionary<int, ServiceProcessRequest>()
+ {
+ { 0, CreateFriendService }
+ };
+ }
+
+ public static long CreateFriendService(ServiceCtx Context)
+ {
+ MakeObject(Context, new IFriendService());
+
+ return 0;
+ }
+ }
+} \ No newline at end of file