IOlscServiceForApplication.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Ryujinx.Common;
  2. using Ryujinx.Common.Logging;
  3. using Ryujinx.HLE.HOS.Services.Account.Acc;
  4. namespace Ryujinx.HLE.HOS.Services.Olsc
  5. {
  6. [Service("olsc:u")] // 10.0.0+
  7. class IOlscServiceForApplication : IpcService
  8. {
  9. private bool _initialized;
  10. public IOlscServiceForApplication(ServiceCtx context) { }
  11. [CommandHipc(0)]
  12. // Initialize(pid)
  13. public ResultCode Initialize(ServiceCtx context)
  14. {
  15. // NOTE: Service call arp:r GetApplicationInstanceUnregistrationNotifier with the pid and initialize some internal struct.
  16. // Since we will not support online savedata backup. It's fine to stub it for now.
  17. _initialized = true;
  18. Logger.Stub?.PrintStub(LogClass.ServiceOlsc);
  19. return ResultCode.Success;
  20. }
  21. [CommandHipc(14)]
  22. // SetSaveDataBackupSettingEnabled(nn::account::Uid, bool)
  23. public ResultCode SetSaveDataBackupSettingEnabled(ServiceCtx context)
  24. {
  25. UserId userId = context.RequestData.ReadStruct<UserId>();
  26. ulong saveDataBackupSettingEnabled = context.RequestData.ReadUInt64();
  27. if (!_initialized)
  28. {
  29. return ResultCode.NotInitialized;
  30. }
  31. if (userId.IsNull)
  32. {
  33. return ResultCode.NullArgument;
  34. }
  35. // NOTE: Service store the UserId and the boolean in an internal SaveDataBackupSettingDatabase object.
  36. // Since we will not support online savedata backup. It's fine to stub it for now.
  37. Logger.Stub?.PrintStub(LogClass.ServiceOlsc, new { userId, saveDataBackupSettingEnabled });
  38. return ResultCode.Success;
  39. }
  40. }
  41. }