yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

Merge pull request #2700 from ogniK5377/GetFriendList

IFriendService::GetFriendList
This commit is contained in:
bunnei 2019-07-10 16:29:48 -04:00 committed by GitHub
commit 93eaea109d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 34 additions and 1 deletions

View File

@ -22,7 +22,7 @@ public:
{0, nullptr, "GetCompletionEvent"}, {0, nullptr, "GetCompletionEvent"},
{1, nullptr, "Cancel"}, {1, nullptr, "Cancel"},
{10100, nullptr, "GetFriendListIds"}, {10100, nullptr, "GetFriendListIds"},
{10101, nullptr, "GetFriendList"}, {10101, &IFriendService::GetFriendList, "GetFriendList"},
{10102, nullptr, "UpdateFriendInfo"}, {10102, nullptr, "UpdateFriendInfo"},
{10110, nullptr, "GetFriendProfileImage"}, {10110, nullptr, "GetFriendProfileImage"},
{10200, nullptr, "SendFriendRequestForApplication"}, {10200, nullptr, "SendFriendRequestForApplication"},
@ -99,6 +99,23 @@ public:
} }
private: private:
enum class PresenceFilter : u32 {
None = 0,
Online = 1,
OnlinePlay = 2,
OnlineOrOnlinePlay = 3,
};
struct SizedFriendFilter {
PresenceFilter presence;
u8 is_favorite;
u8 same_app;
u8 same_app_played;
u8 arbitary_app_played;
u64 group_id;
};
static_assert(sizeof(SizedFriendFilter) == 0x10, "SizedFriendFilter is an invalid size");
void DeclareCloseOnlinePlaySession(Kernel::HLERequestContext& ctx) { void DeclareCloseOnlinePlaySession(Kernel::HLERequestContext& ctx) {
// Stub used by Splatoon 2 // Stub used by Splatoon 2
LOG_WARNING(Service_ACC, "(STUBBED) called"); LOG_WARNING(Service_ACC, "(STUBBED) called");
@ -112,6 +129,22 @@ private:
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
void GetFriendList(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto friend_offset = rp.Pop<u32>();
const auto uuid = rp.PopRaw<Common::UUID>();
[[maybe_unused]] const auto filter = rp.PopRaw<SizedFriendFilter>();
const auto pid = rp.Pop<u64>();
LOG_WARNING(Service_ACC, "(STUBBED) called, offset={}, uuid={}, pid={}", friend_offset,
uuid.Format(), pid);
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push<u32>(0); // Friend count
// TODO(ogniK): Return a buffer of u64s which are the "NetworkServiceAccountId"
}
}; };
class INotificationService final : public ServiceFramework<INotificationService> { class INotificationService final : public ServiceFramework<INotificationService> {