1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 04:02:42 +01:00

NP: Implement sceNpMatching2DeleteServerContext

This commit is contained in:
RipleyTom 2021-11-07 17:26:30 +01:00 committed by kd-11
parent c194804fec
commit dc0793b731
4 changed files with 26 additions and 2 deletions

View File

@ -710,7 +710,7 @@ error_code sceNpBasicRegisterContextSensitiveHandler(vm::cptr<SceNpCommunication
error_code sceNpBasicUnregisterHandler()
{
sceNp.todo("sceNpBasicUnregisterHandler()");
sceNp.notice("sceNpBasicUnregisterHandler()");
auto& nph = g_fxo->get<named_thread<np::np_handler>>();

View File

@ -1299,7 +1299,7 @@ error_code sceNpMatching2SignalingSetCtxOpt(SceNpMatching2ContextId ctxId, s32 o
error_code sceNpMatching2DeleteServerContext(
SceNpMatching2ContextId ctxId, vm::cptr<SceNpMatching2DeleteServerContextRequest> reqParam, vm::cptr<SceNpMatching2RequestOptParam> optParam, vm::ptr<SceNpMatching2RequestId> assignedReqId)
{
sceNp2.todo("sceNpMatching2DeleteServerContext(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
sceNp2.warning("sceNpMatching2DeleteServerContext(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
@ -1307,6 +1307,13 @@ error_code sceNpMatching2DeleteServerContext(
return res;
}
if (reqParam->serverId == 0)
{
return SCE_NP_MATCHING2_ERROR_INVALID_SERVER_ID;
}
*assignedReqId = nph.delete_server_context(ctxId, optParam, reqParam->serverId);
return CELL_OK;
}

View File

@ -92,6 +92,7 @@ namespace np
// Asynchronous requests
u32 get_server_status(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, u16 server_id);
u32 create_server_context(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, u16 server_id);
u32 delete_server_context(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, u16 server_id);
u32 get_world_list(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, u16 server_id);
u32 create_join_room(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2CreateJoinRoomRequest* req);
u32 join_room(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2JoinRoomRequest* req);

View File

@ -69,6 +69,22 @@ namespace np
return req_id;
}
u32 np_handler::delete_server_context(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, u16 /*server_id*/)
{
u32 req_id = generate_callback_info(ctx_id, optParam);
u32 event_key = get_event_key();
const auto cb_info = take_pending_request(req_id);
sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32
{
cb_info.cb(cb_ppu, cb_info.ctx_id, req_id, SCE_NP_MATCHING2_REQUEST_EVENT_DeleteServerContext, event_key, 0, 0, cb_info.cb_arg);
return 0;
});
return req_id;
}
u32 np_handler::get_world_list(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, u16 server_id)
{
u32 req_id = generate_callback_info(ctx_id, optParam);