summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/friend
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-11-30 20:09:22 +0100
committerGitHub <noreply@github.com>2021-11-30 20:09:22 +0100
commitff63080cd9ede8f88d110a666f837a9ef2a0b500 (patch)
tree130688f4bbf8c56c1a38469241ac0efc2eb35825 /src/core/hle/service/friend
parentMerge pull request #7472 from Morph1984/post-kraken-cleanup (diff)
parentservice: friend: Implement GetCompletionEvent (diff)
downloadyuzu-ff63080cd9ede8f88d110a666f837a9ef2a0b500.tar
yuzu-ff63080cd9ede8f88d110a666f837a9ef2a0b500.tar.gz
yuzu-ff63080cd9ede8f88d110a666f837a9ef2a0b500.tar.bz2
yuzu-ff63080cd9ede8f88d110a666f837a9ef2a0b500.tar.lz
yuzu-ff63080cd9ede8f88d110a666f837a9ef2a0b500.tar.xz
yuzu-ff63080cd9ede8f88d110a666f837a9ef2a0b500.tar.zst
yuzu-ff63080cd9ede8f88d110a666f837a9ef2a0b500.zip
Diffstat (limited to 'src/core/hle/service/friend')
-rw-r--r--src/core/hle/service/friend/friend.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp
index 68c9240ae..3c36f4085 100644
--- a/src/core/hle/service/friend/friend.cpp
+++ b/src/core/hle/service/friend/friend.cpp
@@ -17,10 +17,11 @@ namespace Service::Friend {
class IFriendService final : public ServiceFramework<IFriendService> {
public:
- explicit IFriendService(Core::System& system_) : ServiceFramework{system_, "IFriendService"} {
+ explicit IFriendService(Core::System& system_)
+ : ServiceFramework{system_, "IFriendService"}, service_context{system, "IFriendService"} {
// clang-format off
static const FunctionInfo functions[] = {
- {0, nullptr, "GetCompletionEvent"},
+ {0, &IFriendService::GetCompletionEvent, "GetCompletionEvent"},
{1, nullptr, "Cancel"},
{10100, nullptr, "GetFriendListIds"},
{10101, &IFriendService::GetFriendList, "GetFriendList"},
@@ -109,6 +110,12 @@ public:
// clang-format on
RegisterHandlers(functions);
+
+ completion_event = service_context.CreateEvent("IFriendService:CompletionEvent");
+ }
+
+ ~IFriendService() override {
+ service_context.CloseEvent(completion_event);
}
private:
@@ -129,6 +136,14 @@ private:
};
static_assert(sizeof(SizedFriendFilter) == 0x10, "SizedFriendFilter is an invalid size");
+ void GetCompletionEvent(Kernel::HLERequestContext& ctx) {
+ LOG_DEBUG(Service_Friend, "called");
+
+ IPC::ResponseBuilder rb{ctx, 2, 1};
+ rb.Push(ResultSuccess);
+ rb.PushCopyObjects(completion_event->GetReadableEvent());
+ }
+
void GetBlockedUserListIds(Kernel::HLERequestContext& ctx) {
// This is safe to stub, as there should be no adverse consequences from reporting no
// blocked users.
@@ -179,6 +194,10 @@ private:
rb.Push<u32>(0); // Friend count
// TODO(ogniK): Return a buffer of u64s which are the "NetworkServiceAccountId"
}
+
+ KernelHelpers::ServiceContext service_context;
+
+ Kernel::KEvent* completion_event;
};
class INotificationService final : public ServiceFramework<INotificationService> {