IFriendService.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Ryujinx.HLE.HOS.Ipc;
  2. using Ryujinx.HLE.HOS.SystemState;
  3. using Ryujinx.HLE.Logging;
  4. using System.Collections.Generic;
  5. namespace Ryujinx.HLE.HOS.Services.Friend
  6. {
  7. class IFriendService : IpcService
  8. {
  9. private Dictionary<int, ServiceProcessRequest> m_Commands;
  10. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  11. public IFriendService()
  12. {
  13. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  14. {
  15. { 10601, DeclareCloseOnlinePlaySession },
  16. { 10610, UpdateUserPresence }
  17. };
  18. }
  19. public long DeclareCloseOnlinePlaySession(ServiceCtx Context)
  20. {
  21. UserId Uuid = new UserId(
  22. Context.RequestData.ReadInt64(),
  23. Context.RequestData.ReadInt64());
  24. if (Context.Device.System.State.TryGetUser(Uuid, out UserProfile Profile))
  25. {
  26. Profile.OnlinePlayState = OpenCloseState.Closed;
  27. }
  28. return 0;
  29. }
  30. public long UpdateUserPresence(ServiceCtx Context)
  31. {
  32. UserId Uuid = new UserId(
  33. Context.RequestData.ReadInt64(),
  34. Context.RequestData.ReadInt64());
  35. //TODO.
  36. Context.Device.Log.PrintStub(LogClass.ServiceFriend, "Stubbed.");
  37. return 0;
  38. }
  39. }
  40. }