aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2021-12-30 11:42:22 +0100
committerGitHub <noreply@github.com>2021-12-30 11:42:22 +0100
commitb4f8ae7a759670c3fa22ff11e468c677fd64a682 (patch)
tree44f2d55a715635815ff1de68c0593950cf50bf31
parent512cce6ed33dc7b9f581eb51fe53dcaf4c81abde (diff)
friend: Stub IsFriendListCacheAvailable and EnsureFriendListAvailable (#2949)
* friend: Stub IsFriendListCacheAvailable and EnsureFriendListAvailable This PR stubs IsFriendListCacheAvailable and EnsureFriendListAvailable call of friend service which close #2896. Sadly, Super Bomberman R Online is still stuck on the loading screen and keep calling `TryPopFromFriendInvitationStorageChannel`, probably because another issue somewhere. * Add FW version * Apply suggestions from gdkchan Co-authored-by: gdkchan <gab.dark.100@gmail.com> * Update IFriendService.cs Co-authored-by: gdkchan <gab.dark.100@gmail.com>
-rw-r--r--Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs41
1 files changed, 40 insertions, 1 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs b/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs
index c3e1d967..7a98b0e1 100644
--- a/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs
+++ b/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs
@@ -120,6 +120,45 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator
return ResultCode.Success;
}
+ [CommandHipc(10120)] // 10.0.0+
+ // nn::friends::IsFriendListCacheAvailable(nn::account::Uid userId) -> bool
+ public ResultCode IsFriendListCacheAvailable(ServiceCtx context)
+ {
+ UserId userId = context.RequestData.ReadStruct<UserId>();
+
+ if (userId.IsNull)
+ {
+ return ResultCode.InvalidArgument;
+ }
+
+ // TODO: Service mount the friends:/ system savedata and try to load friend.cache file, returns true if exists, false otherwise.
+ // NOTE: If no cache is available, guest then calls nn::friends::EnsureFriendListAvailable, we can avoid that by faking the cache check.
+ context.ResponseData.Write(true);
+
+ // TODO: Since we don't support friend features, it's fine to stub it for now.
+ Logger.Stub?.PrintStub(LogClass.ServiceFriend, new { UserId = userId.ToString() });
+
+ return ResultCode.Success;
+ }
+
+ [CommandHipc(10121)] // 10.0.0+
+ // nn::friends::EnsureFriendListAvailable(nn::account::Uid userId)
+ public ResultCode EnsureFriendListAvailable(ServiceCtx context)
+ {
+ UserId userId = context.RequestData.ReadStruct<UserId>();
+
+ if (userId.IsNull)
+ {
+ return ResultCode.InvalidArgument;
+ }
+
+ // TODO: Service mount the friends:/ system savedata and create a friend.cache file for the given user id.
+ // Since we don't support friend features, it's fine to stub it for now.
+ Logger.Stub?.PrintStub(LogClass.ServiceFriend, new { UserId = userId.ToString() });
+
+ return ResultCode.Success;
+ }
+
[CommandHipc(10400)]
// nn::friends::GetBlockedUserListIds(int offset, nn::account::Uid userId) -> (u32, buffer<nn::account::NetworkServiceAccountId, 0xa>)
public ResultCode GetBlockedUserListIds(ServiceCtx context)
@@ -311,4 +350,4 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator
return ResultCode.Success;
}
}
-} \ No newline at end of file
+}