mirror of
https://codeberg.org/yuzu-emu/yuzu.git
synced 2025-12-16 12:09:04 +00:00
service/friend: Clean up friend service implementation
- Remove unused function stubs - Improve GetCompletionEvent implementation - Clean up response builder naming
This commit is contained in:
parent
18857e90c4
commit
3fd7c1d5f3
@ -22,7 +22,7 @@ public:
|
|||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, &IFriendService::GetCompletionEvent, "GetCompletionEvent"},
|
{0, &IFriendService::GetCompletionEvent, "GetCompletionEvent"},
|
||||||
{1, &IFriendService::Cancel, "Cancel"},
|
{1, nullptr, "Cancel"},
|
||||||
{10100, nullptr, "GetFriendListIds"},
|
{10100, nullptr, "GetFriendListIds"},
|
||||||
{10101, &IFriendService::GetFriendList, "GetFriendList"},
|
{10101, &IFriendService::GetFriendList, "GetFriendList"},
|
||||||
{10102, nullptr, "UpdateFriendInfo"},
|
{10102, nullptr, "UpdateFriendInfo"},
|
||||||
@ -49,7 +49,7 @@ public:
|
|||||||
{20101, &IFriendService::GetNewlyFriendCount, "GetNewlyFriendCount"},
|
{20101, &IFriendService::GetNewlyFriendCount, "GetNewlyFriendCount"},
|
||||||
{20102, nullptr, "GetFriendDetailedInfo"},
|
{20102, nullptr, "GetFriendDetailedInfo"},
|
||||||
{20103, nullptr, "SyncFriendList"},
|
{20103, nullptr, "SyncFriendList"},
|
||||||
{20104, &IFriendService::RequestSyncFriendList, "RequestSyncFriendList"},
|
{20104, nullptr, "RequestSyncFriendList"},
|
||||||
{20110, nullptr, "LoadFriendSetting"},
|
{20110, nullptr, "LoadFriendSetting"},
|
||||||
{20200, &IFriendService::GetReceivedFriendRequestCount, "GetReceivedFriendRequestCount"},
|
{20200, &IFriendService::GetReceivedFriendRequestCount, "GetReceivedFriendRequestCount"},
|
||||||
{20201, nullptr, "GetFriendRequestList"},
|
{20201, nullptr, "GetFriendRequestList"},
|
||||||
@ -62,10 +62,10 @@ public:
|
|||||||
{20401, nullptr, "SyncBlockedUserList"},
|
{20401, nullptr, "SyncBlockedUserList"},
|
||||||
{20500, nullptr, "GetProfileExtraList"},
|
{20500, nullptr, "GetProfileExtraList"},
|
||||||
{20501, nullptr, "GetRelationship"},
|
{20501, nullptr, "GetRelationship"},
|
||||||
{20600, &IFriendService::GetUserPresenceView, "GetUserPresenceView"},
|
{20600, nullptr, "GetUserPresenceView"},
|
||||||
{20700, nullptr, "GetPlayHistoryList"},
|
{20700, nullptr, "GetPlayHistoryList"},
|
||||||
{20701, &IFriendService::GetPlayHistoryStatistics, "GetPlayHistoryStatistics"},
|
{20701, &IFriendService::GetPlayHistoryStatistics, "GetPlayHistoryStatistics"},
|
||||||
{20800, &IFriendService::LoadUserSetting, "LoadUserSetting"},
|
{20800, nullptr, "LoadUserSetting"},
|
||||||
{20801, nullptr, "SyncUserSetting"},
|
{20801, nullptr, "SyncUserSetting"},
|
||||||
{20900, nullptr, "RequestListSummaryOverlayNotification"},
|
{20900, nullptr, "RequestListSummaryOverlayNotification"},
|
||||||
{21000, nullptr, "GetExternalApplicationCatalog"},
|
{21000, nullptr, "GetExternalApplicationCatalog"},
|
||||||
@ -151,23 +151,11 @@ private:
|
|||||||
static_assert(sizeof(FriendsUserSetting) == 0x800, "FriendsUserSetting is an invalid size");
|
static_assert(sizeof(FriendsUserSetting) == 0x800, "FriendsUserSetting is an invalid size");
|
||||||
|
|
||||||
void GetCompletionEvent(HLERequestContext& ctx) {
|
void GetCompletionEvent(HLERequestContext& ctx) {
|
||||||
LOG_DEBUG(Service_Friend, "Retrieving completion event");
|
LOG_DEBUG(Service_Friend, "called");
|
||||||
|
|
||||||
const auto& event = completion_event->GetReadableEvent();
|
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||||
|
rb.Push(ResultSuccess);
|
||||||
IPC::ResponseBuilder response{ctx, 2, 1};
|
rb.PushCopyObjects(completion_event->GetReadableEvent());
|
||||||
response.Push(event.Signal());
|
|
||||||
response.PushCopyObjects(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Cancel(HLERequestContext& ctx) {
|
|
||||||
LOG_DEBUG(Service_Friend, "Cancelling friend service operation");
|
|
||||||
|
|
||||||
const auto& event = completion_event->GetReadableEvent();
|
|
||||||
|
|
||||||
IPC::ResponseBuilder response{ctx, 2};
|
|
||||||
response.Push(ResultSuccess);
|
|
||||||
response.PushCopyObjects(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetFriendList(HLERequestContext& ctx) {
|
void GetFriendList(HLERequestContext& ctx) {
|
||||||
@ -259,13 +247,6 @@ private:
|
|||||||
rb.Push(0);
|
rb.Push(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RequestSyncFriendList(HLERequestContext& ctx) {
|
|
||||||
LOG_DEBUG(Service_Friend, "Friend list sync requested");
|
|
||||||
|
|
||||||
IPC::ResponseBuilder response{ctx, 2};
|
|
||||||
response.Push(ResultSuccess);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GetReceivedFriendRequestCount(HLERequestContext& ctx) {
|
void GetReceivedFriendRequestCount(HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
[[maybe_unused]] const auto uuid = rp.PopRaw<Common::UUID>();
|
[[maybe_unused]] const auto uuid = rp.PopRaw<Common::UUID>();
|
||||||
@ -277,16 +258,6 @@ private:
|
|||||||
rb.Push(0);
|
rb.Push(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetUserPresenceView(HLERequestContext& ctx) {
|
|
||||||
IPC::RequestParser request{ctx};
|
|
||||||
const auto user_id = request.PopRaw<Common::UUID>();
|
|
||||||
|
|
||||||
LOG_DEBUG(Service_Friend, "Getting presence view for user {}", user_id.RawString());
|
|
||||||
|
|
||||||
IPC::ResponseBuilder response{ctx, 2};
|
|
||||||
response.Push(ResultSuccess);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GetPlayHistoryStatistics(HLERequestContext& ctx) {
|
void GetPlayHistoryStatistics(HLERequestContext& ctx) {
|
||||||
LOG_ERROR(Service_Friend, "(STUBBED) called, check in out");
|
LOG_ERROR(Service_Friend, "(STUBBED) called, check in out");
|
||||||
|
|
||||||
@ -313,13 +284,6 @@ private:
|
|||||||
rb.Push(ResultSuccess);
|
rb.Push(ResultSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadUserSetting(HLERequestContext& ctx) {
|
|
||||||
LOG_DEBUG(Service_Friend, "Loading friend service user settings");
|
|
||||||
|
|
||||||
IPC::ResponseBuilder response{ctx, 2};
|
|
||||||
response.Push(ResultSuccess);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GetReceivedFriendInvitationCountCache(HLERequestContext& ctx) {
|
void GetReceivedFriendInvitationCountCache(HLERequestContext& ctx) {
|
||||||
LOG_DEBUG(Service_Friend, "(STUBBED) called, check in out");
|
LOG_DEBUG(Service_Friend, "(STUBBED) called, check in out");
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user