mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
fixed_typemap.hpp: return reference
This commit is contained in:
parent
bbf52f3cea
commit
ea5e837bd6
87 changed files with 3028 additions and 2997 deletions
|
|
@ -178,9 +178,9 @@ error_code sceNpMatching2Init2(u64 stackSize, s32 priority, vm::ptr<SceNpMatchin
|
|||
error_code sceNpMatching2Term(ppu_thread& ppu);
|
||||
error_code sceNpMatching2Term2();
|
||||
|
||||
error_code generic_match2_error_check(const named_thread<np_handler> *nph, SceNpMatching2ContextId ctxId, vm::cptr<void> reqParam, vm::ptr<SceNpMatching2RequestId> assignedReqId)
|
||||
error_code generic_match2_error_check(const named_thread<np_handler>& nph, SceNpMatching2ContextId ctxId, vm::cptr<void> reqParam, vm::ptr<SceNpMatching2RequestId> assignedReqId)
|
||||
{
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -207,11 +207,11 @@ error_code sceNp2Init(u32 poolsize, vm::ptr<void> poolptr)
|
|||
{
|
||||
sceNp2.warning("sceNp2Init(poolsize=0x%x, poolptr=*0x%x)", poolsize, poolptr);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
{
|
||||
std::lock_guard lock(nph->mutex_status);
|
||||
if (nph->is_NP2_init)
|
||||
std::lock_guard lock(nph.mutex_status);
|
||||
if (nph.is_NP2_init)
|
||||
{
|
||||
return SCE_NP_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ error_code sceNp2Init(u32 poolsize, vm::ptr<void> poolptr)
|
|||
return result;
|
||||
}
|
||||
|
||||
nph->is_NP2_init = true;
|
||||
nph.is_NP2_init = true;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -239,14 +239,14 @@ error_code sceNpMatching2Init2(u64 stackSize, s32 priority, vm::ptr<SceNpMatchin
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2Init2(stackSize=0x%x, priority=%d, param=*0x%x)", stackSize, priority, param);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_init)
|
||||
if (!nph.is_NP2_init)
|
||||
{
|
||||
return SCE_NP_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (nph->is_NP2_Match2_init)
|
||||
if (nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
|
|
@ -256,7 +256,7 @@ error_code sceNpMatching2Init2(u64 stackSize, s32 priority, vm::ptr<SceNpMatchin
|
|||
// 2. Create heap area to be used by the NP matching 2 utility
|
||||
// 3. Set maximum lengths for the event data queues in the system
|
||||
|
||||
nph->is_NP2_Match2_init = true;
|
||||
nph.is_NP2_Match2_init = true;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -265,11 +265,11 @@ error_code sceNp2Term(ppu_thread& ppu)
|
|||
{
|
||||
sceNp2.warning("sceNp2Term()");
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
{
|
||||
std::lock_guard lock(nph->mutex_status);
|
||||
if (!nph->is_NP2_init)
|
||||
std::lock_guard lock(nph.mutex_status);
|
||||
if (!nph.is_NP2_init)
|
||||
{
|
||||
return SCE_NP_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -280,7 +280,7 @@ error_code sceNp2Term(ppu_thread& ppu)
|
|||
// cellSysutilUnregisterCallbackDispatcher();
|
||||
sceNpTerm();
|
||||
|
||||
nph->is_NP2_init = false;
|
||||
nph.is_NP2_init = false;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -295,21 +295,21 @@ error_code sceNpMatching2Term2()
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2Term2()");
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
{
|
||||
std::lock_guard lock(nph->mutex_status);
|
||||
if (!nph->is_NP2_init)
|
||||
std::lock_guard lock(nph.mutex_status);
|
||||
if (!nph.is_NP2_init)
|
||||
{
|
||||
return SCE_NP_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
nph->is_NP2_Match2_init = false;
|
||||
nph.is_NP2_Match2_init = false;
|
||||
}
|
||||
|
||||
// TODO: for all contexts: sceNpMatching2DestroyContext
|
||||
|
|
@ -321,9 +321,9 @@ error_code sceNpMatching2DestroyContext(SceNpMatching2ContextId ctxId)
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2DestroyContext(ctxId=%d)", ctxId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -339,7 +339,7 @@ error_code sceNpMatching2LeaveLobby(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2LeaveLobby(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -352,9 +352,9 @@ error_code sceNpMatching2RegisterLobbyMessageCallback(SceNpMatching2ContextId ct
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2RegisterLobbyMessageCallback(ctxId=%d, cbFunc=*0x%x, cbFuncArg=*0x%x)", ctxId, cbFunc, cbFuncArg);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -367,7 +367,7 @@ error_code sceNpMatching2GetWorldInfoList(
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2GetWorldInfoList(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -378,7 +378,7 @@ error_code sceNpMatching2GetWorldInfoList(
|
|||
return SCE_NP_MATCHING2_ERROR_INVALID_SERVER_ID;
|
||||
}
|
||||
|
||||
*assignedReqId = nph->get_world_list(ctxId, optParam, reqParam->serverId);
|
||||
*assignedReqId = nph.get_world_list(ctxId, optParam, reqParam->serverId);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -387,9 +387,9 @@ error_code sceNpMatching2RegisterLobbyEventCallback(SceNpMatching2ContextId ctxI
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2RegisterLobbyEventCallback(ctxId=%d, cbFunc=*0x%x, cbFuncArg=*0x%x)", ctxId, cbFunc, cbFuncArg);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -402,7 +402,7 @@ error_code sceNpMatching2GetLobbyMemberDataInternalList(SceNpMatching2ContextId
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetLobbyMemberDataInternalList(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -416,13 +416,13 @@ error_code sceNpMatching2SearchRoom(
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2SearchRoom(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
*assignedReqId = nph->search_room(ctxId, optParam, reqParam.get_ptr());
|
||||
*assignedReqId = nph.search_room(ctxId, optParam, reqParam.get_ptr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -432,9 +432,9 @@ error_code sceNpMatching2SignalingGetConnectionStatus(
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2SignalingGetConnectionStatus(ctxId=%d, roomId=%d, memberId=%d, connStatus=*0x%x, peerAddr=*0x%x, peerPort=*0x%x)", ctxId, roomId, memberId, connStatus, peerAddr, peerPort);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -444,8 +444,9 @@ error_code sceNpMatching2SignalingGetConnectionStatus(
|
|||
return SCE_NP_MATCHING2_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
const auto sigh = g_fxo->get<named_thread<signaling_handler>>();
|
||||
const auto si = sigh->get_sig2_infos(roomId, memberId);
|
||||
auto& sigh = g_fxo->get<named_thread<signaling_handler>>();
|
||||
|
||||
const auto si = sigh.get_sig2_infos(roomId, memberId);
|
||||
|
||||
*connStatus = si.connStatus;
|
||||
|
||||
|
|
@ -467,7 +468,7 @@ error_code sceNpMatching2SetUserInfo(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SetUserInfo(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -480,9 +481,9 @@ error_code sceNpMatching2GetClanLobbyId(SceNpMatching2ContextId ctxId, SceNpClan
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetClanLobbyId(ctxId=%d, clanId=%d, lobbyId=*0x%x)", ctxId, clanId, lobbyId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -495,7 +496,7 @@ error_code sceNpMatching2GetLobbyMemberDataInternal(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetLobbyMemberDataInternal(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -508,9 +509,9 @@ error_code sceNpMatching2ContextStart(SceNpMatching2ContextId ctxId)
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2ContextStart(ctxId=%d)", ctxId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -521,7 +522,8 @@ error_code sceNpMatching2ContextStart(SceNpMatching2ContextId ctxId)
|
|||
|
||||
if (ctx->context_callback)
|
||||
{
|
||||
sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32 {
|
||||
sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32
|
||||
{
|
||||
ctx->context_callback(cb_ppu, ctxId, SCE_NP_MATCHING2_CONTEXT_EVENT_Start, SCE_NP_MATCHING2_EVENT_CAUSE_CONTEXT_ACTION, 0, ctx->context_callback_param);
|
||||
return 0;
|
||||
});
|
||||
|
|
@ -535,7 +537,7 @@ error_code sceNpMatching2CreateServerContext(
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2CreateServerContext(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -546,7 +548,7 @@ error_code sceNpMatching2CreateServerContext(
|
|||
return SCE_NP_MATCHING2_ERROR_INVALID_SERVER_ID;
|
||||
}
|
||||
|
||||
*assignedReqId = nph->create_server_context(ctxId, optParam, reqParam->serverId);
|
||||
*assignedReqId = nph.create_server_context(ctxId, optParam, reqParam->serverId);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -555,9 +557,9 @@ error_code sceNpMatching2GetMemoryInfo(vm::ptr<SceNpMatching2MemoryInfo> memInfo
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetMemoryInfo(memInfo=*0x%x)", memInfo);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -570,13 +572,13 @@ error_code sceNpMatching2LeaveRoom(
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2LeaveRoom(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
*assignedReqId = nph->leave_room(ctxId, optParam, reqParam.get_ptr());
|
||||
*assignedReqId = nph.leave_room(ctxId, optParam, reqParam.get_ptr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -586,13 +588,13 @@ error_code sceNpMatching2SetRoomDataExternal(
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2SetRoomDataExternal(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
*assignedReqId = nph->set_roomdata_external(ctxId, optParam, reqParam.get_ptr());
|
||||
*assignedReqId = nph.set_roomdata_external(ctxId, optParam, reqParam.get_ptr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -602,9 +604,9 @@ error_code sceNpMatching2SignalingGetConnectionInfo(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SignalingGetConnectionInfo(ctxId=%d, roomId=%d, memberId=%d, code=%d, connInfo=*0x%x)", ctxId, roomId, memberId, code, connInfo);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -623,8 +625,8 @@ error_code sceNpMatching2SignalingGetConnectionInfo(
|
|||
}
|
||||
case 5:
|
||||
{
|
||||
const auto sigh = g_fxo->get<named_thread<signaling_handler>>();
|
||||
const auto si = sigh->get_sig2_infos(roomId, memberId);
|
||||
auto& sigh = g_fxo->get<named_thread<signaling_handler>>();
|
||||
const auto si = sigh.get_sig2_infos(roomId, memberId);
|
||||
connInfo->address.port = std::bit_cast<u16, be_t<u16>>(si.port);
|
||||
connInfo->address.addr.np_s_addr = si.addr;
|
||||
break;
|
||||
|
|
@ -649,13 +651,13 @@ error_code sceNpMatching2SendRoomMessage(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SendRoomMessage(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
*assignedReqId = nph->send_room_message(ctxId, optParam, reqParam.get_ptr());
|
||||
*assignedReqId = nph.send_room_message(ctxId, optParam, reqParam.get_ptr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -665,7 +667,7 @@ error_code sceNpMatching2JoinLobby(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2JoinLobby(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -679,7 +681,7 @@ error_code sceNpMatching2GetRoomMemberDataExternalList(SceNpMatching2ContextId c
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetRoomMemberDataExternalList(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -692,9 +694,9 @@ error_code sceNpMatching2AbortRequest(SceNpMatching2ContextId ctxId, SceNpMatchi
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2AbortRequest(ctxId=%d, reqId=%d)", ctxId, reqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -707,13 +709,13 @@ error_code sceNpMatching2GetServerInfo(
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2GetServerInfo(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
*assignedReqId = nph->get_server_status(ctxId, optParam, reqParam->serverId);
|
||||
*assignedReqId = nph.get_server_status(ctxId, optParam, reqParam->serverId);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -722,9 +724,9 @@ error_code sceNpMatching2GetEventData(SceNpMatching2ContextId ctxId, SceNpMatchi
|
|||
{
|
||||
sceNp2.notice("sceNpMatching2GetEventData(ctxId=%d, eventKey=%d, buf=*0x%x, bufLen=%d)", ctxId, eventKey, buf, bufLen);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -734,16 +736,16 @@ error_code sceNpMatching2GetEventData(SceNpMatching2ContextId ctxId, SceNpMatchi
|
|||
return SCE_NP_MATCHING2_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
return not_an_error(nph->get_match2_event(eventKey, static_cast<u8 *>(buf.get_ptr()), bufLen));
|
||||
return not_an_error(nph.get_match2_event(eventKey, static_cast<u8 *>(buf.get_ptr()), bufLen));
|
||||
}
|
||||
|
||||
error_code sceNpMatching2GetRoomSlotInfoLocal(SceNpMatching2ContextId ctxId, const SceNpMatching2RoomId roomId, vm::ptr<SceNpMatching2RoomSlotInfo> roomSlotInfo)
|
||||
{
|
||||
sceNp2.todo("sceNpMatching2GetRoomSlotInfoLocal(ctxId=%d, roomId=%d, roomSlotInfo=*0x%x)", ctxId, roomId, roomSlotInfo);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -756,7 +758,7 @@ error_code sceNpMatching2SendLobbyChatMessage(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SendLobbyChatMessage(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -769,9 +771,9 @@ error_code sceNpMatching2AbortContextStart(SceNpMatching2ContextId ctxId)
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2AbortContextStart(ctxId=%d)", ctxId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -783,9 +785,9 @@ error_code sceNpMatching2GetRoomMemberIdListLocal(SceNpMatching2ContextId ctxId,
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetRoomMemberIdListLocal(ctxId=%d, roomId=%d, sortMethod=%d, memberId=*0x%x, memberIdNum=%d)", ctxId, roomId, sortMethod, memberId, memberIdNum);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -798,13 +800,13 @@ error_code sceNpMatching2JoinRoom(
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2JoinRoom(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
*assignedReqId = nph->join_room(ctxId, optParam, reqParam.get_ptr());
|
||||
*assignedReqId = nph.join_room(ctxId, optParam, reqParam.get_ptr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -815,9 +817,9 @@ error_code sceNpMatching2GetRoomMemberDataInternalLocal(SceNpMatching2ContextId
|
|||
sceNp2.todo("sceNpMatching2GetRoomMemberDataInternalLocal(ctxId=%d, roomId=%d, memberId=%d, attrId=*0x%x, attrIdNum=%d, member=*0x%x, buf=*0x%x, bufLen=%d)", ctxId, roomId, memberId, attrId,
|
||||
attrIdNum, member, buf, bufLen);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -829,9 +831,9 @@ error_code sceNpMatching2GetCbQueueInfo(SceNpMatching2ContextId ctxId, vm::ptr<S
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetCbQueueInfo(ctxId=%d, queueInfo=*0x%x)", ctxId, queueInfo);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -844,7 +846,7 @@ error_code sceNpMatching2KickoutRoomMember(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2KickoutRoomMember(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -857,9 +859,9 @@ error_code sceNpMatching2ContextStartAsync(SceNpMatching2ContextId ctxId, u32 ti
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2ContextStartAsync(ctxId=%d, timeout=%d)", ctxId, timeout);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -875,7 +877,8 @@ error_code sceNpMatching2ContextStartAsync(SceNpMatching2ContextId ctxId, u32 ti
|
|||
|
||||
if (ctx->context_callback)
|
||||
{
|
||||
sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32 {
|
||||
sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32
|
||||
{
|
||||
ctx->context_callback(cb_ppu, ctxId, SCE_NP_MATCHING2_CONTEXT_EVENT_Start, SCE_NP_MATCHING2_EVENT_CAUSE_CONTEXT_ACTION, 0, ctx->context_callback_param);
|
||||
return 0;
|
||||
});
|
||||
|
|
@ -889,7 +892,7 @@ error_code sceNpMatching2SetSignalingOptParam(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SetSignalingOptParam(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -902,9 +905,9 @@ error_code sceNpMatching2RegisterContextCallback(SceNpMatching2ContextId ctxId,
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2RegisterContextCallback(ctxId=%d, cbFunc=*0x%x, cbFuncArg=*0x%x)", ctxId, cbFunc, cbFuncArg);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -929,7 +932,7 @@ error_code sceNpMatching2SendRoomChatMessage(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SendRoomChatMessage(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -943,13 +946,13 @@ error_code sceNpMatching2SetRoomDataInternal(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SetRoomDataInternal(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
*assignedReqId = nph->set_roomdata_internal(ctxId, optParam, reqParam.get_ptr());
|
||||
*assignedReqId = nph.set_roomdata_internal(ctxId, optParam, reqParam.get_ptr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -959,13 +962,13 @@ error_code sceNpMatching2GetRoomDataInternal(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetRoomDataInternal(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
*assignedReqId = nph->get_roomdata_internal(ctxId, optParam, reqParam.get_ptr());
|
||||
*assignedReqId = nph.get_roomdata_internal(ctxId, optParam, reqParam.get_ptr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -975,13 +978,13 @@ error_code sceNpMatching2SignalingGetPingInfo(
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2SignalingGetPingInfo(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
*assignedReqId = nph->get_ping_info(ctxId, optParam, reqParam.get_ptr());
|
||||
*assignedReqId = nph.get_ping_info(ctxId, optParam, reqParam.get_ptr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -990,9 +993,9 @@ error_code sceNpMatching2GetServerIdListLocal(SceNpMatching2ContextId ctxId, vm:
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetServerIdListLocal(ctxId=%d, serverId=*0x%x, serverIdNum=%d)", ctxId, serverId, serverIdNum);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1002,7 +1005,7 @@ error_code sceNpMatching2GetServerIdListLocal(SceNpMatching2ContextId ctxId, vm:
|
|||
return SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_FOUND;
|
||||
}
|
||||
|
||||
const auto slist = nph->get_match2_server_list(ctxId);
|
||||
const auto slist = nph.get_match2_server_list(ctxId);
|
||||
|
||||
u32 num_servs = std::min(static_cast<u32>(slist.size()), serverIdNum);
|
||||
|
||||
|
|
@ -1040,7 +1043,7 @@ error_code sceNpMatching2GrantRoomOwner(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GrantRoomOwner(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -1054,9 +1057,9 @@ error_code sceNpMatching2CreateContext(
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2CreateContext(npId=*0x%x, commId=*0x%x(%s), passPhrase=*0x%x, ctxId=*0x%x, option=%d)", npId, commId, commId->data, ctxId, option);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1075,9 +1078,9 @@ error_code sceNpMatching2GetSignalingOptParamLocal(SceNpMatching2ContextId ctxId
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetSignalingOptParamLocal(ctxId=%d, roomId=%d, signalingOptParam=*0x%x)", ctxId, roomId, signalingOptParam);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1089,15 +1092,15 @@ error_code sceNpMatching2RegisterSignalingCallback(SceNpMatching2ContextId ctxId
|
|||
{
|
||||
sceNp2.notice("sceNpMatching2RegisterSignalingCallback(ctxId=%d, cbFunc=*0x%x, cbFuncArg=*0x%x)", ctxId, cbFunc, cbFuncArg);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
const auto sigh = g_fxo->get<named_thread<signaling_handler>>();
|
||||
sigh->set_sig2_cb(ctxId, cbFunc, cbFuncArg);
|
||||
auto& sigh = g_fxo->get<named_thread<signaling_handler>>();
|
||||
sigh.set_sig2_cb(ctxId, cbFunc, cbFuncArg);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -1106,9 +1109,9 @@ error_code sceNpMatching2ClearEventData(SceNpMatching2ContextId ctxId, SceNpMatc
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2ClearEventData(ctxId=%d, eventKey=%d)", ctxId, eventKey);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1121,7 +1124,7 @@ error_code sceNpMatching2GetUserInfoList(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetUserInfoList(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -1135,7 +1138,7 @@ error_code sceNpMatching2GetRoomMemberDataInternal(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetRoomMemberDataInternal(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -1149,7 +1152,7 @@ error_code sceNpMatching2SetRoomMemberDataInternal(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SetRoomMemberDataInternal(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -1163,14 +1166,14 @@ error_code sceNpMatching2JoinProhibitiveRoom(
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2JoinProhibitiveRoom(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
// TODO: add blocked users
|
||||
*assignedReqId = nph->join_room(ctxId, optParam, &reqParam->joinParam);
|
||||
*assignedReqId = nph.join_room(ctxId, optParam, &reqParam->joinParam);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -1179,9 +1182,9 @@ error_code sceNpMatching2SignalingSetCtxOpt(SceNpMatching2ContextId ctxId, s32 o
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SignalingSetCtxOpt(ctxId=%d, optname=%d, optval=%d)", ctxId, optname, optval);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1194,7 +1197,7 @@ error_code sceNpMatching2DeleteServerContext(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2DeleteServerContext(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -1207,9 +1210,9 @@ error_code sceNpMatching2SetDefaultRequestOptParam(SceNpMatching2ContextId ctxId
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2SetDefaultRequestOptParam(ctxId=%d, optParam=*0x%x)", ctxId, optParam);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1232,16 +1235,16 @@ error_code sceNpMatching2RegisterRoomEventCallback(SceNpMatching2ContextId ctxId
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2RegisterRoomEventCallback(ctxId=%d, cbFunc=*0x%x, cbFuncArg=*0x%x)", ctxId, cbFunc, cbFuncArg);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
nph->room_event_cb = cbFunc;
|
||||
nph->room_event_cb_ctx = ctxId;
|
||||
nph->room_event_cb_arg = cbFuncArg;
|
||||
nph.room_event_cb = cbFunc;
|
||||
nph.room_event_cb_ctx = ctxId;
|
||||
nph.room_event_cb_arg = cbFuncArg;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -1250,9 +1253,9 @@ error_code sceNpMatching2GetRoomPasswordLocal(SceNpMatching2ContextId ctxId, Sce
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetRoomPasswordLocal(ctxId=%d, roomId=%d, withPassword=*0x%x, roomPassword=*0x%x)", ctxId, roomId, withPassword, roomPassword);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1265,7 +1268,7 @@ error_code sceNpMatching2GetRoomDataExternalList(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetRoomDataExternalList(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -1279,13 +1282,13 @@ error_code sceNpMatching2CreateJoinRoom(
|
|||
{
|
||||
sceNp2.warning("sceNpMatching2CreateJoinRoom(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
*assignedReqId = nph->create_join_room(ctxId, optParam, reqParam.get_ptr());
|
||||
*assignedReqId = nph.create_join_room(ctxId, optParam, reqParam.get_ptr());
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -1294,9 +1297,9 @@ error_code sceNpMatching2SignalingGetCtxOpt(SceNpMatching2ContextId ctxId, s32 o
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SignalingGetCtxOpt(ctxId=%d, optname=%d, optval=*0x%x)", ctxId, optname, optval);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1309,7 +1312,7 @@ error_code sceNpMatching2GetLobbyInfoList(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetLobbyInfoList(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -1323,9 +1326,9 @@ error_code sceNpMatching2GetLobbyMemberIdListLocal(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2GetLobbyMemberIdListLocal(ctxId=%d, lobbyId=%d, memberId=*0x%x, memberIdNum=%d, me=*0x%x)", ctxId, lobbyId, memberId, memberIdNum, me);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1338,7 +1341,7 @@ error_code sceNpMatching2SendLobbyInvitation(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SendLobbyInvitation(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -1351,9 +1354,9 @@ error_code sceNpMatching2ContextStop(SceNpMatching2ContextId ctxId)
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2ContextStop(ctxId=%d)", ctxId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1367,7 +1370,8 @@ error_code sceNpMatching2ContextStop(SceNpMatching2ContextId ctxId)
|
|||
|
||||
if (ctx->context_callback)
|
||||
{
|
||||
sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32 {
|
||||
sysutil_register_cb([=](ppu_thread& cb_ppu) -> s32
|
||||
{
|
||||
ctx->context_callback(cb_ppu, ctxId, SCE_NP_MATCHING2_CONTEXT_EVENT_Stop, SCE_NP_MATCHING2_EVENT_CAUSE_CONTEXT_ACTION, 0, ctx->context_callback_param);
|
||||
return 0;
|
||||
});
|
||||
|
|
@ -1381,7 +1385,7 @@ error_code sceNpMatching2SetLobbyMemberDataInternal(
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SetLobbyMemberDataInternal(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam, assignedReqId); res != CELL_OK)
|
||||
{
|
||||
return res;
|
||||
|
|
@ -1394,16 +1398,16 @@ error_code sceNpMatching2RegisterRoomMessageCallback(SceNpMatching2ContextId ctx
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2RegisterRoomMessageCallback(ctxId=%d, cbFunc=*0x%x, cbFuncArg=*0x%x)", ctxId, cbFunc, cbFuncArg);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
nph->room_msg_cb = cbFunc;
|
||||
nph->room_msg_cb_ctx = ctxId;
|
||||
nph->room_msg_cb_arg = cbFuncArg;
|
||||
nph.room_msg_cb = cbFunc;
|
||||
nph.room_msg_cb_ctx = ctxId;
|
||||
nph.room_msg_cb_arg = cbFuncArg;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -1412,9 +1416,9 @@ error_code sceNpMatching2SignalingCancelPeerNetInfo(SceNpMatching2ContextId ctxI
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SignalingCancelPeerNetInfo(ctxId=%d, reqId=%d)", ctxId, reqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1426,9 +1430,9 @@ error_code sceNpMatching2SignalingGetLocalNetInfo(vm::ptr<SceNpMatching2Signalin
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SignalingGetLocalNetInfo(netinfo=*0x%x)", netinfo);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1446,9 +1450,9 @@ error_code sceNpMatching2SignalingGetPeerNetInfo(SceNpMatching2ContextId ctxId,
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SignalingGetPeerNetInfo(ctxId=%d, roomId=%d, roomMemberId=%d, reqId=*0x%x)", ctxId, roomId, roomMemberId, reqId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1465,9 +1469,9 @@ error_code sceNpMatching2SignalingGetPeerNetInfoResult(SceNpMatching2ContextId c
|
|||
{
|
||||
sceNp2.todo("sceNpMatching2SignalingGetPeerNetInfoResult(ctxId=%d, reqId=%d, netinfo=*0x%x)", ctxId, reqId, netinfo);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP2_Match2_init)
|
||||
if (!nph.is_NP2_Match2_init)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1485,14 +1489,14 @@ error_code sceNpAuthOAuthInit()
|
|||
{
|
||||
sceNp2.todo("sceNpAuthOAuthInit()");
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (nph->is_NP_Auth_init)
|
||||
if (nph.is_NP_Auth_init)
|
||||
{
|
||||
return SCE_NP_OAUTH_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
|
||||
nph->is_NP_Auth_init = true;
|
||||
nph.is_NP_Auth_init = true;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -1501,10 +1505,10 @@ error_code sceNpAuthOAuthTerm()
|
|||
{
|
||||
sceNp2.todo("sceNpAuthOAuthTerm()");
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
// TODO: check if this might throw SCE_NP_OAUTH_ERROR_NOT_INITIALIZED
|
||||
nph->is_NP_Auth_init = false;
|
||||
nph.is_NP_Auth_init = false;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
@ -1513,9 +1517,9 @@ error_code sceNpAuthCreateOAuthRequest()
|
|||
{
|
||||
sceNp2.todo("sceNpAuthCreateOAuthRequest()");
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP_Auth_init)
|
||||
if (!nph.is_NP_Auth_init)
|
||||
{
|
||||
return SCE_NP_OAUTH_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1527,9 +1531,9 @@ error_code sceNpAuthDeleteOAuthRequest(SceNpAuthOAuthRequestId reqId)
|
|||
{
|
||||
sceNp2.todo("sceNpAuthDeleteOAuthRequest(reqId=%d)");
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP_Auth_init)
|
||||
if (!nph.is_NP_Auth_init)
|
||||
{
|
||||
return SCE_NP_OAUTH_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1541,9 +1545,9 @@ error_code sceNpAuthAbortOAuthRequest(SceNpAuthOAuthRequestId reqId)
|
|||
{
|
||||
sceNp2.todo("sceNpAuthAbortOAuthRequest(reqId=%d)");
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP_Auth_init)
|
||||
if (!nph.is_NP_Auth_init)
|
||||
{
|
||||
return SCE_NP_OAUTH_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
@ -1555,9 +1559,9 @@ error_code sceNpAuthGetAuthorizationCode(SceNpAuthOAuthRequestId reqId, vm::cptr
|
|||
{
|
||||
sceNp2.todo("sceNpAuthGetAuthorizationCode(reqId=%d, param=*0x%x, authCode=*0x%x, issuerId=%d)", reqId, param, authCode, issuerId);
|
||||
|
||||
const auto nph = g_fxo->get<named_thread<np_handler>>();
|
||||
auto& nph = g_fxo->get<named_thread<np_handler>>();
|
||||
|
||||
if (!nph->is_NP_Auth_init)
|
||||
if (!nph.is_NP_Auth_init)
|
||||
{
|
||||
return SCE_NP_OAUTH_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue