diff --git a/rpcs3/Emu/NP/np_handler.cpp b/rpcs3/Emu/NP/np_handler.cpp index 30eac7f470..5bf637747c 100644 --- a/rpcs3/Emu/NP/np_handler.cpp +++ b/rpcs3/Emu/NP/np_handler.cpp @@ -1702,4 +1702,16 @@ namespace np return ctx; } + void np_handler::callback_info::queue_callback(u32 req_id, u32 event_key, s32 error_code, u32 data_size) const + { + if (cb) + { + sysutil_register_cb([=, ctx_id = this->ctx_id, event_type = this->event_type, cb = this->cb, cb_arg = this->cb_arg](ppu_thread& cb_ppu) -> s32 + { + cb(cb_ppu, ctx_id, req_id, event_type, event_key, error_code, data_size, cb_arg); + return 0; + }); + } + } + } // namespace np diff --git a/rpcs3/Emu/NP/np_handler.h b/rpcs3/Emu/NP/np_handler.h index c7a086f224..20edfe1e2d 100644 --- a/rpcs3/Emu/NP/np_handler.h +++ b/rpcs3/Emu/NP/np_handler.h @@ -373,17 +373,7 @@ namespace np vm::ptr cb_arg; SceNpMatching2Event event_type; - void queue_callback(u32 req_id, u32 event_key, s32 error_code, u32 data_size) const - { - if (cb) - { - sysutil_register_cb([=, ctx_id = this->ctx_id, event_type = this->event_type, cb = this->cb, cb_arg = this->cb_arg](ppu_thread& cb_ppu) -> s32 - { - cb(cb_ppu, ctx_id, req_id, event_type, event_key, error_code, data_size, cb_arg); - return 0; - }); - } - } + void queue_callback(u32 req_id, u32 event_key, s32 error_code, u32 data_size) const; }; u32 generate_callback_info(SceNpMatching2ContextId ctx_id, vm::cptr optParam, SceNpMatching2Event event_type); diff --git a/rpcs3/Emu/NP/rpcn_client.cpp b/rpcs3/Emu/NP/rpcn_client.cpp index e02078f512..1ebbfdd14e 100644 --- a/rpcs3/Emu/NP/rpcn_client.cpp +++ b/rpcs3/Emu/NP/rpcn_client.cpp @@ -1495,7 +1495,7 @@ namespace rpcn return notifs; } - std::unordered_map>> rpcn_client::get_replies() + std::map>> rpcn_client::get_replies() { std::lock_guard lock(mutex_replies); auto ret_replies = std::move(replies); diff --git a/rpcs3/Emu/NP/rpcn_client.h b/rpcs3/Emu/NP/rpcn_client.h index 11acb291a5..6d7126ffa6 100644 --- a/rpcs3/Emu/NP/rpcn_client.h +++ b/rpcs3/Emu/NP/rpcn_client.h @@ -314,7 +314,7 @@ namespace rpcn std::optional> get_friend_presence_by_npid(const std::string& npid); std::vector>> get_notifications(); - std::unordered_map>> get_replies(); + std::map>> get_replies(); std::unordered_map get_presence_updates(); std::map get_presence_states(); @@ -428,8 +428,8 @@ namespace rpcn shared_mutex mutex_notifs, mutex_replies, mutex_replies_sync, mutex_presence_updates; std::vector>> notifications; // notif type / data - std::unordered_map>> replies; // req id / (command / data) - std::unordered_map>> replies_sync; // same but for sync replies(see handle_input()) + std::map>> replies; // req id / (command / data) + std::map>> replies_sync; // same but for sync replies(see handle_input()) std::unordered_map presence_updates; // npid / presence data // Messages