summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Narr the Reg2024-02-23 12:49:45 -0600
committerGravatar Narr the Reg2024-02-23 18:58:51 -0600
commitc48c182fe0bcbbcde273517956675dc1e0f125c9 (patch)
tree376a0af1df1b65be8c44ab14a4e2e57c9dd97601
parentservice: hid: Add IsAnyCustomButtonConfigEnabled for QLaunch (diff)
downloadyuzu-c48c182fe0bcbbcde273517956675dc1e0f125c9.tar.gz
yuzu-c48c182fe0bcbbcde273517956675dc1e0f125c9.tar.xz
yuzu-c48c182fe0bcbbcde273517956675dc1e0f125c9.zip
service: friend: Add GetFriendCount, GetNewlyFriendCount, GetReceivedFriendRequestCount, GetPlayHistoryStatistics, GetReceivedFriendInvitationCountCache for QLaunch
-rw-r--r--src/core/hle/service/friend/friend.cpp91
1 files changed, 65 insertions, 26 deletions
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp
index aeb849efa..38e62761b 100644
--- a/src/core/hle/service/friend/friend.cpp
+++ b/src/core/hle/service/friend/friend.cpp
@@ -42,13 +42,13 @@ public:
42 {10701, nullptr, "GetPlayHistoryRegistrationKeyWithNetworkServiceAccountId"}, 42 {10701, nullptr, "GetPlayHistoryRegistrationKeyWithNetworkServiceAccountId"},
43 {10702, nullptr, "AddPlayHistory"}, 43 {10702, nullptr, "AddPlayHistory"},
44 {11000, nullptr, "GetProfileImageUrl"}, 44 {11000, nullptr, "GetProfileImageUrl"},
45 {20100, nullptr, "GetFriendCount"}, 45 {20100, &IFriendService::GetFriendCount, "GetFriendCount"},
46 {20101, nullptr, "GetNewlyFriendCount"}, 46 {20101, &IFriendService::GetNewlyFriendCount, "GetNewlyFriendCount"},
47 {20102, nullptr, "GetFriendDetailedInfo"}, 47 {20102, nullptr, "GetFriendDetailedInfo"},
48 {20103, nullptr, "SyncFriendList"}, 48 {20103, nullptr, "SyncFriendList"},
49 {20104, nullptr, "RequestSyncFriendList"}, 49 {20104, nullptr, "RequestSyncFriendList"},
50 {20110, nullptr, "LoadFriendSetting"}, 50 {20110, nullptr, "LoadFriendSetting"},
51 {20200, nullptr, "GetReceivedFriendRequestCount"}, 51 {20200, &IFriendService::GetReceivedFriendRequestCount, "GetReceivedFriendRequestCount"},
52 {20201, nullptr, "GetFriendRequestList"}, 52 {20201, nullptr, "GetFriendRequestList"},
53 {20300, nullptr, "GetFriendCandidateList"}, 53 {20300, nullptr, "GetFriendCandidateList"},
54 {20301, nullptr, "GetNintendoNetworkIdInfo"}, 54 {20301, nullptr, "GetNintendoNetworkIdInfo"},
@@ -61,14 +61,14 @@ public:
61 {20501, nullptr, "GetRelationship"}, 61 {20501, nullptr, "GetRelationship"},
62 {20600, nullptr, "GetUserPresenceView"}, 62 {20600, nullptr, "GetUserPresenceView"},
63 {20700, nullptr, "GetPlayHistoryList"}, 63 {20700, nullptr, "GetPlayHistoryList"},
64 {20701, nullptr, "GetPlayHistoryStatistics"}, 64 {20701, &IFriendService::GetPlayHistoryStatistics, "GetPlayHistoryStatistics"},
65 {20800, nullptr, "LoadUserSetting"}, 65 {20800, nullptr, "LoadUserSetting"},
66 {20801, nullptr, "SyncUserSetting"}, 66 {20801, nullptr, "SyncUserSetting"},
67 {20900, nullptr, "RequestListSummaryOverlayNotification"}, 67 {20900, nullptr, "RequestListSummaryOverlayNotification"},
68 {21000, nullptr, "GetExternalApplicationCatalog"}, 68 {21000, nullptr, "GetExternalApplicationCatalog"},
69 {22000, nullptr, "GetReceivedFriendInvitationList"}, 69 {22000, nullptr, "GetReceivedFriendInvitationList"},
70 {22001, nullptr, "GetReceivedFriendInvitationDetailedInfo"}, 70 {22001, nullptr, "GetReceivedFriendInvitationDetailedInfo"},
71 {22010, nullptr, "GetReceivedFriendInvitationCountCache"}, 71 {22010, &IFriendService::GetReceivedFriendInvitationCountCache, "GetReceivedFriendInvitationCountCache"},
72 {30100, nullptr, "DropFriendNewlyFlags"}, 72 {30100, nullptr, "DropFriendNewlyFlags"},
73 {30101, nullptr, "DeleteFriend"}, 73 {30101, nullptr, "DeleteFriend"},
74 {30110, nullptr, "DropFriendNewlyFlag"}, 74 {30110, nullptr, "DropFriendNewlyFlag"},
@@ -144,6 +144,33 @@ private:
144 rb.PushCopyObjects(completion_event->GetReadableEvent()); 144 rb.PushCopyObjects(completion_event->GetReadableEvent());
145 } 145 }
146 146
147 void GetFriendList(HLERequestContext& ctx) {
148 IPC::RequestParser rp{ctx};
149 const auto friend_offset = rp.Pop<u32>();
150 const auto uuid = rp.PopRaw<Common::UUID>();
151 [[maybe_unused]] const auto filter = rp.PopRaw<SizedFriendFilter>();
152 const auto pid = rp.Pop<u64>();
153 LOG_WARNING(Service_Friend, "(STUBBED) called, offset={}, uuid=0x{}, pid={}", friend_offset,
154 uuid.RawString(), pid);
155
156 IPC::ResponseBuilder rb{ctx, 3};
157 rb.Push(ResultSuccess);
158
159 rb.Push<u32>(0); // Friend count
160 // TODO(ogniK): Return a buffer of u64s which are the "NetworkServiceAccountId"
161 }
162
163 void CheckFriendListAvailability(HLERequestContext& ctx) {
164 IPC::RequestParser rp{ctx};
165 const auto uuid{rp.PopRaw<Common::UUID>()};
166
167 LOG_WARNING(Service_Friend, "(STUBBED) called, uuid=0x{}", uuid.RawString());
168
169 IPC::ResponseBuilder rb{ctx, 3};
170 rb.Push(ResultSuccess);
171 rb.Push(true);
172 }
173
147 void GetBlockedUserListIds(HLERequestContext& ctx) { 174 void GetBlockedUserListIds(HLERequestContext& ctx) {
148 // This is safe to stub, as there should be no adverse consequences from reporting no 175 // This is safe to stub, as there should be no adverse consequences from reporting no
149 // blocked users. 176 // blocked users.
@@ -153,6 +180,17 @@ private:
153 rb.Push<u32>(0); // Indicates there are no blocked users 180 rb.Push<u32>(0); // Indicates there are no blocked users
154 } 181 }
155 182
183 void CheckBlockedUserListAvailability(HLERequestContext& ctx) {
184 IPC::RequestParser rp{ctx};
185 const auto uuid{rp.PopRaw<Common::UUID>()};
186
187 LOG_WARNING(Service_Friend, "(STUBBED) called, uuid=0x{}", uuid.RawString());
188
189 IPC::ResponseBuilder rb{ctx, 3};
190 rb.Push(ResultSuccess);
191 rb.Push(true);
192 }
193
156 void DeclareCloseOnlinePlaySession(HLERequestContext& ctx) { 194 void DeclareCloseOnlinePlaySession(HLERequestContext& ctx) {
157 // Stub used by Splatoon 2 195 // Stub used by Splatoon 2
158 LOG_WARNING(Service_Friend, "(STUBBED) called"); 196 LOG_WARNING(Service_Friend, "(STUBBED) called");
@@ -179,42 +217,43 @@ private:
179 rb.Push(ResultSuccess); 217 rb.Push(ResultSuccess);
180 } 218 }
181 219
182 void GetFriendList(HLERequestContext& ctx) { 220 void GetFriendCount(HLERequestContext& ctx) {
183 IPC::RequestParser rp{ctx}; 221 LOG_DEBUG(Service_Friend, "(STUBBED) called");
184 const auto friend_offset = rp.Pop<u32>();
185 const auto uuid = rp.PopRaw<Common::UUID>();
186 [[maybe_unused]] const auto filter = rp.PopRaw<SizedFriendFilter>();
187 const auto pid = rp.Pop<u64>();
188 LOG_WARNING(Service_Friend, "(STUBBED) called, offset={}, uuid=0x{}, pid={}", friend_offset,
189 uuid.RawString(), pid);
190 222
191 IPC::ResponseBuilder rb{ctx, 3}; 223 IPC::ResponseBuilder rb{ctx, 3};
192 rb.Push(ResultSuccess); 224 rb.Push(ResultSuccess);
193 225 rb.Push(0);
194 rb.Push<u32>(0); // Friend count
195 // TODO(ogniK): Return a buffer of u64s which are the "NetworkServiceAccountId"
196 } 226 }
197 227
198 void CheckFriendListAvailability(HLERequestContext& ctx) { 228 void GetNewlyFriendCount(HLERequestContext& ctx) {
199 IPC::RequestParser rp{ctx}; 229 LOG_DEBUG(Service_Friend, "(STUBBED) called");
200 const auto uuid{rp.PopRaw<Common::UUID>()};
201 230
202 LOG_WARNING(Service_Friend, "(STUBBED) called, uuid=0x{}", uuid.RawString()); 231 IPC::ResponseBuilder rb{ctx, 3};
232 rb.Push(ResultSuccess);
233 rb.Push(0);
234 }
235
236 void GetReceivedFriendRequestCount(HLERequestContext& ctx) {
237 LOG_DEBUG(Service_Friend, "(STUBBED) called");
203 238
204 IPC::ResponseBuilder rb{ctx, 3}; 239 IPC::ResponseBuilder rb{ctx, 3};
205 rb.Push(ResultSuccess); 240 rb.Push(ResultSuccess);
206 rb.Push(true); 241 rb.Push(0);
207 } 242 }
208 243
209 void CheckBlockedUserListAvailability(HLERequestContext& ctx) { 244 void GetPlayHistoryStatistics(HLERequestContext& ctx) {
210 IPC::RequestParser rp{ctx}; 245 LOG_ERROR(Service_Friend, "(STUBBED) called, check in out");
211 const auto uuid{rp.PopRaw<Common::UUID>()};
212 246
213 LOG_WARNING(Service_Friend, "(STUBBED) called, uuid=0x{}", uuid.RawString()); 247 IPC::ResponseBuilder rb{ctx, 2};
248 rb.Push(ResultSuccess);
249 }
250
251 void GetReceivedFriendInvitationCountCache(HLERequestContext& ctx) {
252 LOG_DEBUG(Service_Friend, "(STUBBED) called, check in out");
214 253
215 IPC::ResponseBuilder rb{ctx, 3}; 254 IPC::ResponseBuilder rb{ctx, 3};
216 rb.Push(ResultSuccess); 255 rb.Push(ResultSuccess);
217 rb.Push(true); 256 rb.Push(0);
218 } 257 }
219 258
220 KernelHelpers::ServiceContext service_context; 259 KernelHelpers::ServiceContext service_context;