summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Marcec <dmarcecguzman@gmail.com>2019-06-28 07:29:38 +0200
committerDavid Marcec <dmarcecguzman@gmail.com>2019-06-28 07:29:38 +0200
commitc2146c4eefdb67e64a9cb572d52391dfbb5b0f80 (patch)
tree3f7d68a86aebca57fb66d427c210731ea1b9160a /src
parentSizedNotificationInfo should be 0x10 bytes, user_uuid is incorrect, this should be the users account id (diff)
downloadyuzu-c2146c4eefdb67e64a9cb572d52391dfbb5b0f80.tar
yuzu-c2146c4eefdb67e64a9cb572d52391dfbb5b0f80.tar.gz
yuzu-c2146c4eefdb67e64a9cb572d52391dfbb5b0f80.tar.bz2
yuzu-c2146c4eefdb67e64a9cb572d52391dfbb5b0f80.tar.lz
yuzu-c2146c4eefdb67e64a9cb572d52391dfbb5b0f80.tar.xz
yuzu-c2146c4eefdb67e64a9cb572d52391dfbb5b0f80.tar.zst
yuzu-c2146c4eefdb67e64a9cb572d52391dfbb5b0f80.zip
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 @@
-// Copyright 2018 yuzu emulator team
+// Copyright 2019 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
@@ -9,4 +9,5 @@
namespace Service::Friend {
constexpr ResultCode ERR_NO_NOTIFICATIONS{ErrorModule::Account, 15};
+
}
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:
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
- if (is_event_created) {
- rb.PushCopyObjects(notification_event.readable);
- } else {
+ if (!is_event_created) {
auto& kernel = Core::System::GetInstance().Kernel();
notification_event = Kernel::WritableEvent::CreateEventPair(
kernel, Kernel::ResetType::Manual, "INotificationService:NotifyEvent");
is_event_created = true;
- rb.PushCopyObjects(notification_event.readable);
}
+ rb.PushCopyObjects(notification_event.readable);
}
void Clear(Kernel::HLERequestContext& ctx) {
@@ -151,8 +149,7 @@ private:
while (!notifications.empty()) {
notifications.pop();
}
- states.has_received_friend_request = false;
- states.has_updated_friends = false;
+ std::memset(&states, 0, sizeof(States));
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
@@ -167,9 +164,8 @@ private:
rb.Push(ERR_NO_NOTIFICATIONS);
return;
}
- IPC::ResponseBuilder rb{ctx, 6};
- auto notification = notifications.front();
+ const auto notification = notifications.front();
notifications.pop();
switch (notification.notification_type) {
@@ -185,11 +181,13 @@ private:
static_cast<u32>(notification.notification_type));
break;
}
+
+ IPC::ResponseBuilder rb{ctx, 6};
rb.Push(RESULT_SUCCESS);
rb.PushRaw<SizedNotificationInfo>(notification);
}
- enum class NotificationTypes : u32_le {
+ enum class NotificationTypes : u32 {
HasUpdatedFriendsList = 0x65,
HasReceivedFriendRequest = 0x1
};
@@ -208,10 +206,10 @@ private:
bool has_received_friend_request;
};
- Common::UUID uuid{};
+ Common::UUID uuid;
bool is_event_created = false;
Kernel::EventPair notification_event;
- std::queue<SizedNotificationInfo> notifications{};
+ std::queue<SizedNotificationInfo> notifications;
States states{};
};
@@ -226,10 +224,11 @@ void Module::Interface::CreateNotificationService(Kernel::HLERequestContext& ctx
IPC::RequestParser rp{ctx};
auto uuid = rp.PopRaw<Common::UUID>();
+ LOG_DEBUG(Service_ACC, "called, uuid={}", uuid.Format());
+
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(RESULT_SUCCESS);
rb.PushIpcInterface<INotificationService>(uuid);
- LOG_DEBUG(Service_ACC, "called");
}
Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)