summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Morph2021-11-30 12:19:21 -0500
committerGravatar Morph2021-11-30 12:19:21 -0500
commit505ae5ea1bec7e17dba3d1b4382a839797eff83d (patch)
tree130688f4bbf8c56c1a38469241ac0efc2eb35825 /src
parentMerge pull request #7472 from Morph1984/post-kraken-cleanup (diff)
downloadyuzu-505ae5ea1bec7e17dba3d1b4382a839797eff83d.tar.gz
yuzu-505ae5ea1bec7e17dba3d1b4382a839797eff83d.tar.xz
yuzu-505ae5ea1bec7e17dba3d1b4382a839797eff83d.zip
service: friend: Implement GetCompletionEvent
- Used by Super Bomberman R Online
Diffstat (limited to 'src')
-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 {
17 17
18class IFriendService final : public ServiceFramework<IFriendService> { 18class IFriendService final : public ServiceFramework<IFriendService> {
19public: 19public:
20 explicit IFriendService(Core::System& system_) : ServiceFramework{system_, "IFriendService"} { 20 explicit IFriendService(Core::System& system_)
21 : ServiceFramework{system_, "IFriendService"}, service_context{system, "IFriendService"} {
21 // clang-format off 22 // clang-format off
22 static const FunctionInfo functions[] = { 23 static const FunctionInfo functions[] = {
23 {0, nullptr, "GetCompletionEvent"}, 24 {0, &IFriendService::GetCompletionEvent, "GetCompletionEvent"},
24 {1, nullptr, "Cancel"}, 25 {1, nullptr, "Cancel"},
25 {10100, nullptr, "GetFriendListIds"}, 26 {10100, nullptr, "GetFriendListIds"},
26 {10101, &IFriendService::GetFriendList, "GetFriendList"}, 27 {10101, &IFriendService::GetFriendList, "GetFriendList"},
@@ -109,6 +110,12 @@ public:
109 // clang-format on 110 // clang-format on
110 111
111 RegisterHandlers(functions); 112 RegisterHandlers(functions);
113
114 completion_event = service_context.CreateEvent("IFriendService:CompletionEvent");
115 }
116
117 ~IFriendService() override {
118 service_context.CloseEvent(completion_event);
112 } 119 }
113 120
114private: 121private:
@@ -129,6 +136,14 @@ private:
129 }; 136 };
130 static_assert(sizeof(SizedFriendFilter) == 0x10, "SizedFriendFilter is an invalid size"); 137 static_assert(sizeof(SizedFriendFilter) == 0x10, "SizedFriendFilter is an invalid size");
131 138
139 void GetCompletionEvent(Kernel::HLERequestContext& ctx) {
140 LOG_DEBUG(Service_Friend, "called");
141
142 IPC::ResponseBuilder rb{ctx, 2, 1};
143 rb.Push(ResultSuccess);
144 rb.PushCopyObjects(completion_event->GetReadableEvent());
145 }
146
132 void GetBlockedUserListIds(Kernel::HLERequestContext& ctx) { 147 void GetBlockedUserListIds(Kernel::HLERequestContext& ctx) {
133 // This is safe to stub, as there should be no adverse consequences from reporting no 148 // This is safe to stub, as there should be no adverse consequences from reporting no
134 // blocked users. 149 // blocked users.
@@ -179,6 +194,10 @@ private:
179 rb.Push<u32>(0); // Friend count 194 rb.Push<u32>(0); // Friend count
180 // TODO(ogniK): Return a buffer of u64s which are the "NetworkServiceAccountId" 195 // TODO(ogniK): Return a buffer of u64s which are the "NetworkServiceAccountId"
181 } 196 }
197
198 KernelHelpers::ServiceContext service_context;
199
200 Kernel::KEvent* completion_event;
182}; 201};
183 202
184class INotificationService final : public ServiceFramework<INotificationService> { 203class INotificationService final : public ServiceFramework<INotificationService> {