From d1a7bb01364ff6372567c623069f0f5edafdbc96 Mon Sep 17 00:00:00 2001 From: RipleyTom Date: Wed, 28 Sep 2022 10:57:19 +0200 Subject: [PATCH] Fix faulty GetScoreFriendsRequest --- rpcs3/Emu/Cell/Modules/sceNp.cpp | 8 ++++---- rpcs3/Emu/NP/np_handler.h | 2 +- rpcs3/Emu/NP/np_requests.cpp | 8 ++++---- rpcs3/Emu/NP/rpcn_client.cpp | 4 ++-- rpcs3/Emu/NP/rpcn_client.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/sceNp.cpp b/rpcs3/Emu/Cell/Modules/sceNp.cpp index 070e97049a..ee176603d5 100644 --- a/rpcs3/Emu/Cell/Modules/sceNp.cpp +++ b/rpcs3/Emu/Cell/Modules/sceNp.cpp @@ -4146,7 +4146,7 @@ error_code sceNpScoreRecordScoreAsync(s32 transId, SceNpScoreBoardId boardId, Sc return scenp_score_record_score(transId, boardId, score, scoreComment, gameInfo, tmpRank, option, true); } -error_code scenp_score_record_game_data(s32 transId, SceNpScoreBoardId boardId, SceNpScoreValue score, u64 totalSize, u64 sendSize, vm::cptr data, vm::ptr option, bool async) +error_code scenp_score_record_game_data(s32 transId, SceNpScoreBoardId /* boardId */, SceNpScoreValue /* score */, u64 /* totalSize */, u64 /* sendSize */, vm::cptr data, vm::ptr option, bool /* async */) { auto& nph = g_fxo->get>(); @@ -4194,7 +4194,7 @@ error_code sceNpScoreRecordGameDataAsync(s32 transId, SceNpScoreBoardId boardId, return scenp_score_record_game_data(transId, boardId, score, totalSize, sendSize, data, option, true); } -error_code scenp_score_get_game_data(s32 transId, SceNpScoreBoardId boardId, vm::cptr npId, vm::ptr totalSize, u64 recvSize, vm::ptr data, vm::ptr option, bool async) +error_code scenp_score_get_game_data(s32 /* transId */, SceNpScoreBoardId /* boardId */, vm::cptr npId, vm::ptr totalSize, u64 /* recvSize */, vm::ptr data, vm::ptr option, bool /* async */) { auto& nph = g_fxo->get>(); @@ -4239,7 +4239,7 @@ error_code sceNpScoreGetGameDataAsync(s32 transId, SceNpScoreBoardId boardId, vm template error_code scenp_score_get_ranking_by_npid(s32 transId, SceNpScoreBoardId boardId, T npIdArray, u64 npIdArraySize, vm::ptr rankArray, u64 rankArraySize, vm::ptr commentArray, u64 commentArraySize, vm::ptr infoArray, u64 infoArraySize, u64 arrayNum, vm::ptr lastSortDate, - vm::ptr totalRecord, vm::ptr option, bool async) + vm::ptr totalRecord, vm::ptr /* option */, bool async) { auto& nph = g_fxo->get>(); @@ -4504,7 +4504,7 @@ error_code scenp_score_get_friends_ranking(s32 transId, SceNpScoreBoardId boardI return SCE_NP_COMMUNITY_ERROR_INVALID_ONLINE_ID; } - nph.get_score_friend(trans_ctx, boardId, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, totalRecord, async); + nph.get_score_friend(trans_ctx, boardId, includeSelf, rankArray, rankArraySize, commentArray, commentArraySize, infoArray, infoArraySize, arrayNum, lastSortDate, totalRecord, async); if (async) { diff --git a/rpcs3/Emu/NP/np_handler.h b/rpcs3/Emu/NP/np_handler.h index cdf1bd3d73..d176225058 100644 --- a/rpcs3/Emu/NP/np_handler.h +++ b/rpcs3/Emu/NP/np_handler.h @@ -159,7 +159,7 @@ namespace np void record_score(std::shared_ptr& trans_ctx, SceNpScoreBoardId board_id, SceNpScoreValue score, vm::cptr comment, const u8* data, u32 data_size, vm::ptr tmp_rank, bool async); void get_score_range(std::shared_ptr& trans_ctx, SceNpScoreBoardId boardId, SceNpScoreRankNumber startSerialRank, vm::ptr rankArray, u64 rankArraySize, vm::ptr commentArray, u64 commentArraySize, vm::ptr infoArray, u64 infoArraySize, u64 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, bool async); void get_score_npid(std::shared_ptr& trans_ctx, SceNpScoreBoardId boardId, const std::vector>& npid_vec, vm::ptr rankArray, u64 rankArraySize, vm::ptr commentArray, u64 commentArraySize, vm::ptr infoArray, u64 infoArraySize, u64 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, bool async); - void get_score_friend(std::shared_ptr& trans_ctx, SceNpScoreBoardId boardId, vm::ptr rankArray, u64 rankArraySize, vm::ptr commentArray, u64 commentArraySize, vm::ptr infoArray, u64 infoArraySize, u64 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, bool async); + void get_score_friend(std::shared_ptr& trans_ctx, SceNpScoreBoardId boardId, bool include_self, vm::ptr rankArray, u64 rankArraySize, vm::ptr commentArray, u64 commentArraySize, vm::ptr infoArray, u64 infoArraySize, u64 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, bool async); // Local functions std::pair> local_get_room_slots(SceNpMatching2RoomId room_id); diff --git a/rpcs3/Emu/NP/np_requests.cpp b/rpcs3/Emu/NP/np_requests.cpp index 3cbe7dbc27..a5c2eee631 100644 --- a/rpcs3/Emu/NP/np_requests.cpp +++ b/rpcs3/Emu/NP/np_requests.cpp @@ -867,11 +867,11 @@ namespace np return true; } - bool np_handler::reply_store_score_data(u32 req_id, std::vector& reply_data) + bool np_handler::reply_store_score_data(u32 /* req_id */, std::vector& /* reply_data */) { return true; } - bool np_handler::reply_get_score_data(u32 req_id, std::vector& reply_data) + bool np_handler::reply_get_score_data(u32 /* req_id */, std::vector& /* reply_data */) { return true; } @@ -1008,7 +1008,7 @@ namespace np return handle_GetScoreResponse(req_id, reply_data); } - void np_handler::get_score_friend(std::shared_ptr& trans_ctx, SceNpScoreBoardId boardId, vm::ptr rankArray, [[maybe_unused]] u64 rankArraySize, vm::ptr commentArray, [[maybe_unused]] u64 commentArraySize, vm::ptr infoArray, u64 infoArraySize, u64 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, bool async) + void np_handler::get_score_friend(std::shared_ptr& trans_ctx, SceNpScoreBoardId boardId, bool include_self, vm::ptr rankArray, [[maybe_unused]] u64 rankArraySize, vm::ptr commentArray, [[maybe_unused]] u64 commentArraySize, vm::ptr infoArray, u64 infoArraySize, u64 arrayNum, vm::ptr lastSortDate, vm::ptr totalRecord, bool async) { std::unique_lock lock(trans_ctx->mutex); u32 req_id = get_req_id(0x3334); @@ -1024,7 +1024,7 @@ namespace np bool with_comments = !!commentArray; bool with_gameinfo = !!infoArray; - rpcn->get_score_friend(req_id, trans_ctx->communicationId, boardId, with_comments, with_gameinfo); + rpcn->get_score_friend(req_id, trans_ctx->communicationId, boardId, include_self, with_comments, with_gameinfo, arrayNum); return score_async_handler(std::move(lock), trans_ctx, req_id, async); } diff --git a/rpcs3/Emu/NP/rpcn_client.cpp b/rpcs3/Emu/NP/rpcn_client.cpp index cd4ec4499a..41a65eb379 100644 --- a/rpcs3/Emu/NP/rpcn_client.cpp +++ b/rpcs3/Emu/NP/rpcn_client.cpp @@ -1824,11 +1824,11 @@ namespace rpcn return forge_send(CommandType::GetScoreNpid, req_id, data); } - bool rpcn_client::get_score_friend(u32 req_id, const SceNpCommunicationId& communication_id, SceNpScoreBoardId board_id, bool with_comment, bool with_gameinfo) + bool rpcn_client::get_score_friend(u32 req_id, const SceNpCommunicationId& communication_id, SceNpScoreBoardId board_id, bool include_self, bool with_comment, bool with_gameinfo, u32 max_entries) { std::vector data; flatbuffers::FlatBufferBuilder builder(1024); - auto req_finished = CreateGetScoreFriendsRequest(builder, board_id, with_comment, with_gameinfo); + auto req_finished = CreateGetScoreFriendsRequest(builder, board_id, include_self, max_entries, with_comment, with_gameinfo); builder.Finish(req_finished); u8* buf = builder.GetBufferPointer(); diff --git a/rpcs3/Emu/NP/rpcn_client.h b/rpcs3/Emu/NP/rpcn_client.h index 94fa06327a..6de34ad0a9 100644 --- a/rpcs3/Emu/NP/rpcn_client.h +++ b/rpcs3/Emu/NP/rpcn_client.h @@ -367,7 +367,7 @@ namespace rpcn bool record_score(u32 req_id, const SceNpCommunicationId& communication_id, SceNpScoreBoardId board_id, SceNpScorePcId char_id, SceNpScoreValue score, const std::optional comment, const std::optional> score_data); bool get_score_range(u32 req_id, const SceNpCommunicationId& communication_id, SceNpScoreBoardId board_id, u32 start_rank, u32 num_rank, bool with_comment, bool with_gameinfo); bool get_score_npid(u32 req_id, const SceNpCommunicationId& communication_id, SceNpScoreBoardId board_id, const std::vector>& npids, bool with_comment, bool with_gameinfo); - bool get_score_friend(u32 req_id, const SceNpCommunicationId& communication_id, SceNpScoreBoardId board_id, bool with_comment, bool with_gameinfo); + bool get_score_friend(u32 req_id, const SceNpCommunicationId& communication_id, SceNpScoreBoardId board_id, bool include_self, bool with_comment, bool with_gameinfo, u32 max_entries); const std::string& get_online_name() const {