summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar David Marcec2019-06-28 15:29:38 +1000
committerGravatar David Marcec2019-06-28 15:29:38 +1000
commitc2146c4eefdb67e64a9cb572d52391dfbb5b0f80 (patch)
tree3f7d68a86aebca57fb66d427c210731ea1b9160a /src
parentSizedNotificationInfo should be 0x10 bytes, user_uuid is incorrect, this shou... (diff)
downloadyuzu-c2146c4eefdb67e64a9cb572d52391dfbb5b0f80.tar.gz
yuzu-c2146c4eefdb67e64a9cb572d52391dfbb5b0f80.tar.xz
yuzu-c2146c4eefdb67e64a9cb572d52391dfbb5b0f80.zip
Addressed issues
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/friend/errors.h3
-rw-r--r--src/core/hle/service/friend/friend.cpp23
2 files changed, 13 insertions, 13 deletions
diff --git a/src/core/hle/service/friend/errors.h b/src/core/hle/service/friend/errors.h
index 72d96b555..b8314eb3f 100644
--- a/src/core/hle/service/friend/errors.h
+++ b/src/core/hle/service/friend/errors.h
@@ -1,4 +1,4 @@
1// Copyright 2018 yuzu emulator team 1// Copyright 2019 yuzu emulator team
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
@@ -9,4 +9,5 @@
9namespace Service::Friend { 9namespace Service::Friend {
10 10
11constexpr ResultCode ERR_NO_NOTIFICATIONS{ErrorModule::Account, 15}; 11constexpr ResultCode ERR_NO_NOTIFICATIONS{ErrorModule::Account, 15};
12
12} 13}
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp
index 296babc7c..dec541f2e 100644
--- a/src/core/hle/service/friend/friend.cpp
+++ b/src/core/hle/service/friend/friend.cpp
@@ -135,15 +135,13 @@ private:
135 IPC::ResponseBuilder rb{ctx, 2, 1}; 135 IPC::ResponseBuilder rb{ctx, 2, 1};
136 rb.Push(RESULT_SUCCESS); 136 rb.Push(RESULT_SUCCESS);
137 137
138 if (is_event_created) { 138 if (!is_event_created) {
139 rb.PushCopyObjects(notification_event.readable);
140 } else {
141 auto& kernel = Core::System::GetInstance().Kernel(); 139 auto& kernel = Core::System::GetInstance().Kernel();
142 notification_event = Kernel::WritableEvent::CreateEventPair( 140 notification_event = Kernel::WritableEvent::CreateEventPair(
143 kernel, Kernel::ResetType::Manual, "INotificationService:NotifyEvent"); 141 kernel, Kernel::ResetType::Manual, "INotificationService:NotifyEvent");
144 is_event_created = true; 142 is_event_created = true;
145 rb.PushCopyObjects(notification_event.readable);
146 } 143 }
144 rb.PushCopyObjects(notification_event.readable);
147 } 145 }
148 146
149 void Clear(Kernel::HLERequestContext& ctx) { 147 void Clear(Kernel::HLERequestContext& ctx) {
@@ -151,8 +149,7 @@ private:
151 while (!notifications.empty()) { 149 while (!notifications.empty()) {
152 notifications.pop(); 150 notifications.pop();
153 } 151 }
154 states.has_received_friend_request = false; 152 std::memset(&states, 0, sizeof(States));
155 states.has_updated_friends = false;
156 153
157 IPC::ResponseBuilder rb{ctx, 2}; 154 IPC::ResponseBuilder rb{ctx, 2};
158 rb.Push(RESULT_SUCCESS); 155 rb.Push(RESULT_SUCCESS);
@@ -167,9 +164,8 @@ private:
167 rb.Push(ERR_NO_NOTIFICATIONS); 164 rb.Push(ERR_NO_NOTIFICATIONS);
168 return; 165 return;
169 } 166 }
170 IPC::ResponseBuilder rb{ctx, 6};
171 167
172 auto notification = notifications.front(); 168 const auto notification = notifications.front();
173 notifications.pop(); 169 notifications.pop();
174 170
175 switch (notification.notification_type) { 171 switch (notification.notification_type) {
@@ -185,11 +181,13 @@ private:
185 static_cast<u32>(notification.notification_type)); 181 static_cast<u32>(notification.notification_type));
186 break; 182 break;
187 } 183 }
184
185 IPC::ResponseBuilder rb{ctx, 6};
188 rb.Push(RESULT_SUCCESS); 186 rb.Push(RESULT_SUCCESS);
189 rb.PushRaw<SizedNotificationInfo>(notification); 187 rb.PushRaw<SizedNotificationInfo>(notification);
190 } 188 }
191 189
192 enum class NotificationTypes : u32_le { 190 enum class NotificationTypes : u32 {
193 HasUpdatedFriendsList = 0x65, 191 HasUpdatedFriendsList = 0x65,
194 HasReceivedFriendRequest = 0x1 192 HasReceivedFriendRequest = 0x1
195 }; 193 };
@@ -208,10 +206,10 @@ private:
208 bool has_received_friend_request; 206 bool has_received_friend_request;
209 }; 207 };
210 208
211 Common::UUID uuid{}; 209 Common::UUID uuid;
212 bool is_event_created = false; 210 bool is_event_created = false;
213 Kernel::EventPair notification_event; 211 Kernel::EventPair notification_event;
214 std::queue<SizedNotificationInfo> notifications{}; 212 std::queue<SizedNotificationInfo> notifications;
215 States states{}; 213 States states{};
216}; 214};
217 215
@@ -226,10 +224,11 @@ void Module::Interface::CreateNotificationService(Kernel::HLERequestContext& ctx
226 IPC::RequestParser rp{ctx}; 224 IPC::RequestParser rp{ctx};
227 auto uuid = rp.PopRaw<Common::UUID>(); 225 auto uuid = rp.PopRaw<Common::UUID>();
228 226
227 LOG_DEBUG(Service_ACC, "called, uuid={}", uuid.Format());
228
229 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 229 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
230 rb.Push(RESULT_SUCCESS); 230 rb.Push(RESULT_SUCCESS);
231 rb.PushIpcInterface<INotificationService>(uuid); 231 rb.PushIpcInterface<INotificationService>(uuid);
232 LOG_DEBUG(Service_ACC, "called");
233} 232}
234 233
235Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) 234Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)