1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 04:02:42 +01:00
This commit is contained in:
RipleyTom 2024-01-14 12:36:23 +01:00 committed by GitHub
parent 3d974eed03
commit fe9a24a1b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 458 additions and 6 deletions

View File

@ -413,6 +413,70 @@ void fmt_class_string<SceNpError>::format(std::string& out, u64 arg)
STR_CASE(SCE_NP_EULA_ERROR_CONF_INVALID_COUNTRY);
STR_CASE(SCE_NP_EULA_ERROR_CONF_INVALID_NPCOMMID);
STR_CASE(SCE_NP_EULA_ERROR_CONF_INVALID_EULA_VERSION);
STR_CASE(SCE_NP_MATCHING_ERROR_NOT_INITIALIZED);
STR_CASE(SCE_NP_MATCHING_ERROR_ALREADY_INITIALIZED);
STR_CASE(SCE_NP_MATCHING_ERROR_INVALID_ARG);
STR_CASE(SCE_NP_MATCHING_ERROR_TERMINATED);
STR_CASE(SCE_NP_MATCHING_ERROR_TIMEOUT);
STR_CASE(SCE_NP_MATCHING_ERROR_OUT_OF_MEMORY);
STR_CASE(SCE_NP_MATCHING_ERROR_CTXID_NOT_AVAIL);
STR_CASE(SCE_NP_MATCHING_ERROR_CTX_ALREADY_EXIST);
STR_CASE(SCE_NP_MATCHING_ERROR_CTX_NOT_FOUND);
STR_CASE(SCE_NP_MATCHING_ERROR_LOBBY_NOT_FOUND);
STR_CASE(SCE_NP_MATCHING_ERROR_ROOM_NOT_FOUND);
STR_CASE(SCE_NP_MATCHING_ERROR_MEMBER_NOT_FOUND);
STR_CASE(SCE_NP_MATCHING_ERROR_TOO_BIG_VALUE);
STR_CASE(SCE_NP_MATCHING_ERROR_IVALID_ATTR_TYPE);
STR_CASE(SCE_NP_MATCHING_ERROR_INVALID_ATTR_ID);
STR_CASE(SCE_NP_MATCHING_ERROR_ALREADY_REQUESTED);
STR_CASE(SCE_NP_MATCHING_ERROR_LIMITTED_SEATING);
STR_CASE(SCE_NP_MATCHING_ERROR_LOCKED);
STR_CASE(SCE_NP_MATCHING_ERROR_CTX_STILL_RUNNING);
STR_CASE(SCE_NP_MATCHING_ERROR_INSUFFICIENT_BUFFER);
STR_CASE(SCE_NP_MATCHING_ERROR_REQUEST_NOT_ALLOWED);
STR_CASE(SCE_NP_MATCHING_ERROR_CTX_MAX);
STR_CASE(SCE_NP_MATCHING_ERROR_INVALID_REQ_ID);
STR_CASE(SCE_NP_MATCHING_ERROR_RESULT_NOT_FOUND);
STR_CASE(SCE_NP_MATCHING_ERROR_BUSY);
STR_CASE(SCE_NP_MATCHING_ERROR_ALREADY_JOINED_ROOM);
STR_CASE(SCE_NP_MATCHING_ERROR_ROOM_MAX);
STR_CASE(SCE_NP_MATCHING_ERROR_QUICK_MATCH_PLAYER_NOT_FOUND);
STR_CASE(SCE_NP_MATCHING_ERROR_COND_MAX);
STR_CASE(SCE_NP_MATCHING_ERROR_INVALID_COND);
STR_CASE(SCE_NP_MATCHING_ERROR_INVALID_ATTR);
STR_CASE(SCE_NP_MATCHING_ERROR_COMP_OP_INEQUALITY_MAX);
STR_CASE(SCE_NP_MATCHING_ERROR_RESULT_OVERFLOWED);
STR_CASE(SCE_NP_MATCHING_ERROR_HTTPXML_TIMEOUT);
STR_CASE(SCE_NP_MATCHING_ERROR_CANCELED);
STR_CASE(SCE_NP_MATCHING_ERROR_SEARCH_JOIN_ROOM_NOT_FOUND);
STR_CASE(SCE_NP_MATCHING_ERROR_INVALID_COMP_OP);
STR_CASE(SCE_NP_MATCHING_ERROR_INVALID_COMP_TYPE);
STR_CASE(SCE_NP_MATCHING_ERROR_REQUEST_NOT_FOUND);
STR_CASE(SCE_NP_MATCHING_ERROR_INTERNAL_ERROR);
STR_CASE(SCE_NP_MATCHING_ERROR_INVALID_PROTOCOL_ID);
STR_CASE(SCE_NP_MATCHING_ERROR_ATTR_NOT_SPECIFIED);
STR_CASE(SCE_NP_MATCHING_ERROR_SYSUTIL_INVALID_RESULT);
STR_CASE(SCE_NP_MATCHING_ERROR_PLUGIN_LOAD_FAILURE);
STR_CASE(SCE_NP_MATCHING_ERROR_INVALID_ATTR_VALUE);
STR_CASE(SCE_NP_MATCHING_ERROR_DUPLICATE);
STR_CASE(SCE_NP_MATCHING_ERROR_INVALID_MEMORY_CONTAINER);
STR_CASE(SCE_NP_MATCHING_ERROR_SHUTDOWN);
STR_CASE(SCE_NP_MATCHING_ERROR_SYSUTIL_SERVER_BUSY);
STR_CASE(SCE_NP_MATCHING_ERROR_SEND_INVITATION_PARTIALLY_FAILED);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_OUT_OF_SERVICE);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_MAINTENANCE);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_SERVER_BUSY);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_ACCESS_FORBIDDEN);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_NO_SUCH_SERVER);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_NO_SUCH_LOBBY);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_NO_SUCH_ROOM);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_NO_SUCH_USER);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_NOT_ALLOWED);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_UNKNOWN);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_BAD_REQUEST_STANZA);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_REQUEST_FORBIDDEN);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_INTERNAL_ERROR);
STR_CASE(SCE_NP_MATCHING_SERVER_ERROR_ROOM_OVER);
}
return unknown;
@ -3813,6 +3877,11 @@ error_code sceNpMatchingCreateRoomGUI(u32 ctx_id, vm::cptr<SceNpCommunicationId>
{
sceNp.todo("sceNpMatchingCreateRoomGUI(ctx_id=%d, communicationId=*0x%x, attr=*0x%x, handler=*0x%x, arg=*0x%x)", ctx_id, communicationId, attr, handler, arg);
if (!communicationId || !handler)
{
return SCE_NP_MATCHING_ERROR_INVALID_ARG;
}
return CELL_OK;
}

View File

@ -460,7 +460,7 @@ enum SceNpError : u32
SCE_NP_EULA_ERROR_INVALID_ARGUMENT = 0x8002e501,
SCE_NP_EULA_ERROR_NOT_INITIALIZED = 0x8002e502,
SCE_NP_EULA_ERROR_ALREADY_INITIALIZED = 0x8002e503,
SCE_NP_EULA_ERROR_OUT_OF_MEMORY = 0x8002E504,
SCE_NP_EULA_ERROR_OUT_OF_MEMORY = 0x8002e504,
SCE_NP_EULA_ERROR_BUSY = 0x8002e505,
SCE_NP_EULA_ERROR_EULA_NOT_FOUND = 0x8002e5a0,
SCE_NP_EULA_ERROR_NET_OUT_OF_MEMORY = 0x8002e5a1,
@ -471,6 +471,72 @@ enum SceNpError : u32
SCE_NP_EULA_ERROR_CONF_INVALID_COUNTRY = 0x8002e5b4,
SCE_NP_EULA_ERROR_CONF_INVALID_NPCOMMID = 0x8002e5b5,
SCE_NP_EULA_ERROR_CONF_INVALID_EULA_VERSION = 0x8002e5b6,
// Matching
SCE_NP_MATCHING_ERROR_NOT_INITIALIZED = 0x8002a701,
SCE_NP_MATCHING_ERROR_ALREADY_INITIALIZED = 0x8002a702,
SCE_NP_MATCHING_ERROR_INVALID_ARG = 0x8002a703,
SCE_NP_MATCHING_ERROR_TERMINATED = 0x8002a704,
SCE_NP_MATCHING_ERROR_TIMEOUT = 0x8002a705,
SCE_NP_MATCHING_ERROR_OUT_OF_MEMORY = 0x8002a706,
SCE_NP_MATCHING_ERROR_CTXID_NOT_AVAIL = 0x8002a707,
SCE_NP_MATCHING_ERROR_CTX_ALREADY_EXIST = 0x8002a708,
SCE_NP_MATCHING_ERROR_CTX_NOT_FOUND = 0x8002a709,
SCE_NP_MATCHING_ERROR_LOBBY_NOT_FOUND = 0x8002a70a,
SCE_NP_MATCHING_ERROR_ROOM_NOT_FOUND = 0x8002a70b,
SCE_NP_MATCHING_ERROR_MEMBER_NOT_FOUND = 0x8002a70c,
SCE_NP_MATCHING_ERROR_TOO_BIG_VALUE = 0x8002a70d,
SCE_NP_MATCHING_ERROR_IVALID_ATTR_TYPE = 0x8002a70e,
SCE_NP_MATCHING_ERROR_INVALID_ATTR_ID = 0x8002a70f,
SCE_NP_MATCHING_ERROR_ALREADY_REQUESTED = 0x8002a710,
SCE_NP_MATCHING_ERROR_LIMITTED_SEATING = 0x8002a711,
SCE_NP_MATCHING_ERROR_LOCKED = 0x8002a712,
SCE_NP_MATCHING_ERROR_CTX_STILL_RUNNING = 0x8002a713,
SCE_NP_MATCHING_ERROR_INSUFFICIENT_BUFFER = 0x8002a714,
SCE_NP_MATCHING_ERROR_REQUEST_NOT_ALLOWED = 0x8002a715,
SCE_NP_MATCHING_ERROR_CTX_MAX = 0x8002a716,
SCE_NP_MATCHING_ERROR_INVALID_REQ_ID = 0x8002a717,
SCE_NP_MATCHING_ERROR_RESULT_NOT_FOUND = 0x8002a718,
SCE_NP_MATCHING_ERROR_BUSY = 0x8002a719,
SCE_NP_MATCHING_ERROR_ALREADY_JOINED_ROOM = 0x8002a71a,
SCE_NP_MATCHING_ERROR_ROOM_MAX = 0x8002a71b,
SCE_NP_MATCHING_ERROR_QUICK_MATCH_PLAYER_NOT_FOUND = 0x8002a71c,
SCE_NP_MATCHING_ERROR_COND_MAX = 0x8002a71d,
SCE_NP_MATCHING_ERROR_INVALID_COND = 0x8002a71e,
SCE_NP_MATCHING_ERROR_INVALID_ATTR = 0x8002a71f,
SCE_NP_MATCHING_ERROR_COMP_OP_INEQUALITY_MAX = 0x8002a720,
SCE_NP_MATCHING_ERROR_RESULT_OVERFLOWED = 0x8002a721,
SCE_NP_MATCHING_ERROR_HTTPXML_TIMEOUT = 0x8002a722,
SCE_NP_MATCHING_ERROR_CANCELED = 0x8002a723,
SCE_NP_MATCHING_ERROR_SEARCH_JOIN_ROOM_NOT_FOUND = 0x8002a724,
SCE_NP_MATCHING_ERROR_INVALID_COMP_OP = 0x8002a725,
SCE_NP_MATCHING_ERROR_INVALID_COMP_TYPE = 0x8002a726,
SCE_NP_MATCHING_ERROR_REQUEST_NOT_FOUND = 0x8002a727,
SCE_NP_MATCHING_ERROR_INTERNAL_ERROR = 0x8002a728,
SCE_NP_MATCHING_ERROR_INVALID_PROTOCOL_ID = 0x8002a729,
SCE_NP_MATCHING_ERROR_ATTR_NOT_SPECIFIED = 0x8002a72a,
SCE_NP_MATCHING_ERROR_SYSUTIL_INVALID_RESULT = 0x8002a72b,
SCE_NP_MATCHING_ERROR_PLUGIN_LOAD_FAILURE = 0x8002a72c,
SCE_NP_MATCHING_ERROR_INVALID_ATTR_VALUE = 0x8002a72d,
SCE_NP_MATCHING_ERROR_DUPLICATE = 0x8002a72e,
SCE_NP_MATCHING_ERROR_INVALID_MEMORY_CONTAINER = 0x8002a72f,
SCE_NP_MATCHING_ERROR_SHUTDOWN = 0x8002a730,
SCE_NP_MATCHING_ERROR_SYSUTIL_SERVER_BUSY = 0x8002a731,
SCE_NP_MATCHING_ERROR_SEND_INVITATION_PARTIALLY_FAILED = 0x8002a732,
SCE_NP_MATCHING_SERVER_ERROR_OUT_OF_SERVICE = 0x8002a740,
SCE_NP_MATCHING_SERVER_ERROR_MAINTENANCE = 0x8002a741,
SCE_NP_MATCHING_SERVER_ERROR_SERVER_BUSY = 0x8002a742,
SCE_NP_MATCHING_SERVER_ERROR_ACCESS_FORBIDDEN = 0x8002a743,
SCE_NP_MATCHING_SERVER_ERROR_NO_SUCH_SERVER = 0x8002a744,
SCE_NP_MATCHING_SERVER_ERROR_NO_SUCH_LOBBY = 0x8002a745,
SCE_NP_MATCHING_SERVER_ERROR_NO_SUCH_ROOM = 0x8002a746,
SCE_NP_MATCHING_SERVER_ERROR_NO_SUCH_USER = 0x8002a747,
SCE_NP_MATCHING_SERVER_ERROR_NOT_ALLOWED = 0x8002a748,
SCE_NP_MATCHING_SERVER_ERROR_UNKNOWN = 0x8002a749,
SCE_NP_MATCHING_SERVER_ERROR_BAD_REQUEST_STANZA = 0x8002a74a,
SCE_NP_MATCHING_SERVER_ERROR_REQUEST_FORBIDDEN = 0x8002a74b,
SCE_NP_MATCHING_SERVER_ERROR_INTERNAL_ERROR = 0x8002a74c,
SCE_NP_MATCHING_SERVER_ERROR_ROOM_OVER = 0x8002a74d,
};
// Basic presence options

View File

@ -504,7 +504,7 @@ error_code sceNpMatching2SignalingGetConnectionStatus(
error_code sceNpMatching2SetUserInfo(
SceNpMatching2ContextId ctxId, vm::cptr<SceNpMatching2SetUserInfoRequest> reqParam, vm::cptr<SceNpMatching2RequestOptParam> optParam, vm::ptr<SceNpMatching2RequestId> assignedReqId)
{
sceNp2.todo("sceNpMatching2SetUserInfo(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
sceNp2.warning("sceNpMatching2SetUserInfo(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); res != CELL_OK)
@ -512,6 +512,13 @@ error_code sceNpMatching2SetUserInfo(
return res;
}
const u32 request_id = nph.set_userinfo(ctxId, optParam, reqParam.get_ptr());
if (assignedReqId)
{
*assignedReqId = request_id;
}
return CELL_OK;
}
@ -1363,7 +1370,7 @@ error_code sceNpMatching2GetUserInfoList(
error_code sceNpMatching2GetRoomMemberDataInternal(
SceNpMatching2ContextId ctxId, vm::cptr<SceNpMatching2GetRoomMemberDataInternalRequest> reqParam, vm::cptr<SceNpMatching2RequestOptParam> optParam, vm::ptr<SceNpMatching2RequestId> assignedReqId)
{
sceNp2.todo("sceNpMatching2GetRoomMemberDataInternal(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
sceNp2.warning("sceNpMatching2GetRoomMemberDataInternal(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); res != CELL_OK)
@ -1371,6 +1378,13 @@ error_code sceNpMatching2GetRoomMemberDataInternal(
return res;
}
const u32 request_id = nph.get_roommemberdata_internal(ctxId, optParam, reqParam.get_ptr());
if (assignedReqId)
{
*assignedReqId = request_id;
}
return CELL_OK;
}

View File

@ -193,6 +193,12 @@ table SetRoomDataInternalRequest {
ownerPrivilegeRank:[uint16];
}
table GetRoomMemberDataInternalRequest {
roomId:uint64;
memberId:uint16;
attrId:[uint16];
}
table SetRoomMemberDataInternalRequest {
roomId:uint64;
memberId:uint16;
@ -200,6 +206,11 @@ table SetRoomMemberDataInternalRequest {
roomMemberBinAttrInternal:[BinAttr];
}
table SetUserInfo {
serverId:uint16;
userBinAttr:[BinAttr];
}
table GetRoomDataInternalRequest {
roomId:uint64;
attrId:[uint16];

View File

@ -85,9 +85,15 @@ struct SetRoomDataExternalRequestBuilder;
struct SetRoomDataInternalRequest;
struct SetRoomDataInternalRequestBuilder;
struct GetRoomMemberDataInternalRequest;
struct GetRoomMemberDataInternalRequestBuilder;
struct SetRoomMemberDataInternalRequest;
struct SetRoomMemberDataInternalRequestBuilder;
struct SetUserInfo;
struct SetUserInfoBuilder;
struct GetRoomDataInternalRequest;
struct GetRoomDataInternalRequestBuilder;
@ -2609,6 +2615,81 @@ inline ::flatbuffers::Offset<SetRoomDataInternalRequest> CreateSetRoomDataIntern
ownerPrivilegeRank__);
}
struct GetRoomMemberDataInternalRequest FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
typedef GetRoomMemberDataInternalRequestBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_ROOMID = 4,
VT_MEMBERID = 6,
VT_ATTRID = 8
};
uint64_t roomId() const {
return GetField<uint64_t>(VT_ROOMID, 0);
}
uint16_t memberId() const {
return GetField<uint16_t>(VT_MEMBERID, 0);
}
const ::flatbuffers::Vector<uint16_t> *attrId() const {
return GetPointer<const ::flatbuffers::Vector<uint16_t> *>(VT_ATTRID);
}
bool Verify(::flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<uint64_t>(verifier, VT_ROOMID, 8) &&
VerifyField<uint16_t>(verifier, VT_MEMBERID, 2) &&
VerifyOffset(verifier, VT_ATTRID) &&
verifier.VerifyVector(attrId()) &&
verifier.EndTable();
}
};
struct GetRoomMemberDataInternalRequestBuilder {
typedef GetRoomMemberDataInternalRequest Table;
::flatbuffers::FlatBufferBuilder &fbb_;
::flatbuffers::uoffset_t start_;
void add_roomId(uint64_t roomId) {
fbb_.AddElement<uint64_t>(GetRoomMemberDataInternalRequest::VT_ROOMID, roomId, 0);
}
void add_memberId(uint16_t memberId) {
fbb_.AddElement<uint16_t>(GetRoomMemberDataInternalRequest::VT_MEMBERID, memberId, 0);
}
void add_attrId(::flatbuffers::Offset<::flatbuffers::Vector<uint16_t>> attrId) {
fbb_.AddOffset(GetRoomMemberDataInternalRequest::VT_ATTRID, attrId);
}
explicit GetRoomMemberDataInternalRequestBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
::flatbuffers::Offset<GetRoomMemberDataInternalRequest> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = ::flatbuffers::Offset<GetRoomMemberDataInternalRequest>(end);
return o;
}
};
inline ::flatbuffers::Offset<GetRoomMemberDataInternalRequest> CreateGetRoomMemberDataInternalRequest(
::flatbuffers::FlatBufferBuilder &_fbb,
uint64_t roomId = 0,
uint16_t memberId = 0,
::flatbuffers::Offset<::flatbuffers::Vector<uint16_t>> attrId = 0) {
GetRoomMemberDataInternalRequestBuilder builder_(_fbb);
builder_.add_roomId(roomId);
builder_.add_attrId(attrId);
builder_.add_memberId(memberId);
return builder_.Finish();
}
inline ::flatbuffers::Offset<GetRoomMemberDataInternalRequest> CreateGetRoomMemberDataInternalRequestDirect(
::flatbuffers::FlatBufferBuilder &_fbb,
uint64_t roomId = 0,
uint16_t memberId = 0,
const std::vector<uint16_t> *attrId = nullptr) {
auto attrId__ = attrId ? _fbb.CreateVector<uint16_t>(*attrId) : 0;
return CreateGetRoomMemberDataInternalRequest(
_fbb,
roomId,
memberId,
attrId__);
}
struct SetRoomMemberDataInternalRequest FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
typedef SetRoomMemberDataInternalRequestBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
@ -2697,6 +2778,70 @@ inline ::flatbuffers::Offset<SetRoomMemberDataInternalRequest> CreateSetRoomMemb
roomMemberBinAttrInternal__);
}
struct SetUserInfo FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
typedef SetUserInfoBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_SERVERID = 4,
VT_USERBINATTR = 6
};
uint16_t serverId() const {
return GetField<uint16_t>(VT_SERVERID, 0);
}
const ::flatbuffers::Vector<::flatbuffers::Offset<BinAttr>> *userBinAttr() const {
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<BinAttr>> *>(VT_USERBINATTR);
}
bool Verify(::flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<uint16_t>(verifier, VT_SERVERID, 2) &&
VerifyOffset(verifier, VT_USERBINATTR) &&
verifier.VerifyVector(userBinAttr()) &&
verifier.VerifyVectorOfTables(userBinAttr()) &&
verifier.EndTable();
}
};
struct SetUserInfoBuilder {
typedef SetUserInfo Table;
::flatbuffers::FlatBufferBuilder &fbb_;
::flatbuffers::uoffset_t start_;
void add_serverId(uint16_t serverId) {
fbb_.AddElement<uint16_t>(SetUserInfo::VT_SERVERID, serverId, 0);
}
void add_userBinAttr(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<BinAttr>>> userBinAttr) {
fbb_.AddOffset(SetUserInfo::VT_USERBINATTR, userBinAttr);
}
explicit SetUserInfoBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
::flatbuffers::Offset<SetUserInfo> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = ::flatbuffers::Offset<SetUserInfo>(end);
return o;
}
};
inline ::flatbuffers::Offset<SetUserInfo> CreateSetUserInfo(
::flatbuffers::FlatBufferBuilder &_fbb,
uint16_t serverId = 0,
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<BinAttr>>> userBinAttr = 0) {
SetUserInfoBuilder builder_(_fbb);
builder_.add_userBinAttr(userBinAttr);
builder_.add_serverId(serverId);
return builder_.Finish();
}
inline ::flatbuffers::Offset<SetUserInfo> CreateSetUserInfoDirect(
::flatbuffers::FlatBufferBuilder &_fbb,
uint16_t serverId = 0,
const std::vector<::flatbuffers::Offset<BinAttr>> *userBinAttr = nullptr) {
auto userBinAttr__ = userBinAttr ? _fbb.CreateVector<::flatbuffers::Offset<BinAttr>>(*userBinAttr) : 0;
return CreateSetUserInfo(
_fbb,
serverId,
userBinAttr__);
}
struct GetRoomDataInternalRequest FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
typedef GetRoomDataInternalRequestBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {

View File

@ -1014,7 +1014,9 @@ namespace np
case rpcn::CommandType::SetRoomDataExternal: reply_set_roomdata_external(req_id, data); break;
case rpcn::CommandType::GetRoomDataInternal: reply_get_roomdata_internal(req_id, data); break;
case rpcn::CommandType::SetRoomDataInternal: reply_set_roomdata_internal(req_id, data); break;
case rpcn::CommandType::GetRoomMemberDataInternal: reply_get_roommemberdata_internal(req_id, data); break;
case rpcn::CommandType::SetRoomMemberDataInternal: reply_set_roommemberdata_internal(req_id, data); break;
case rpcn::CommandType::SetUserInfo: reply_set_userinfo(req_id, data); break;
case rpcn::CommandType::PingRoomOwner: reply_get_ping_info(req_id, data); break;
case rpcn::CommandType::SendRoomMessage: reply_send_room_message(req_id, data); break;
case rpcn::CommandType::RequestSignalingInfos: reply_req_sign_infos(req_id, data); break;

View File

@ -159,7 +159,9 @@ namespace np
u32 set_roomdata_external(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2SetRoomDataExternalRequest* req);
u32 get_roomdata_internal(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2GetRoomDataInternalRequest* req);
u32 set_roomdata_internal(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2SetRoomDataInternalRequest* req);
u32 get_roommemberdata_internal(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2GetRoomMemberDataInternalRequest* req);
u32 set_roommemberdata_internal(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2SetRoomMemberDataInternalRequest* req);
u32 set_userinfo(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2SetUserInfoRequest* req);
u32 get_ping_info(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2SignalingGetPingInfoRequest* req);
u32 send_room_message(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2SendRoomMessageRequest* req);
@ -268,6 +270,8 @@ namespace np
bool reply_get_roomdata_internal(u32 req_id, std::vector<u8>& reply_data);
bool reply_set_roomdata_internal(u32 req_id, std::vector<u8>& reply_data);
bool reply_set_roommemberdata_internal(u32 req_id, std::vector<u8>& reply_data);
bool reply_get_roommemberdata_internal(u32 req_id, std::vector<u8>& reply_data);
bool reply_set_userinfo(u32 req_id, std::vector<u8>& reply_data);
bool reply_get_ping_info(u32 req_id, std::vector<u8>& reply_data);
bool reply_send_room_message(u32 req_id, std::vector<u8>& reply_data);
bool reply_req_sign_infos(u32 req_id, std::vector<u8>& reply_data);

View File

@ -460,8 +460,6 @@ namespace np
{
u32 req_id = generate_callback_info(ctx_id, optParam, SCE_NP_MATCHING2_REQUEST_EVENT_SetRoomDataInternal);
// TODO: extra_nps::print_set_roomdata_req(req);
extra_nps::print_set_roomdata_int_req(req);
if (!get_rpcn()->set_roomdata_internal(req_id, get_match2_context(ctx_id)->communicationId, req))
@ -485,6 +483,61 @@ namespace np
return true;
}
u32 np_handler::get_roommemberdata_internal(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2GetRoomMemberDataInternalRequest* req)
{
u32 req_id = generate_callback_info(ctx_id, optParam, SCE_NP_MATCHING2_REQUEST_EVENT_GetRoomMemberDataInternal);
extra_nps::print_get_roommemberdata_int_req(req);
if (!get_rpcn()->get_roommemberdata_internal(req_id, get_match2_context(ctx_id)->communicationId, req))
{
rpcn_log.error("Disconnecting from RPCN!");
is_psn_active = false;
}
return req_id;
}
bool np_handler::reply_get_roommemberdata_internal(u32 req_id, std::vector<u8>& reply_data)
{
auto cb_info_opt = take_pending_request(req_id);
if (!cb_info_opt)
return true;
if (rpcn::is_error(static_cast<rpcn::ErrorType>(reply_data[0])))
{
switch (reply_data[0])
{
case rpcn::ErrorType::NotFound:
{
rpcn_log.error("GetRoomMemberDataInternal: Room or User wasn't found");
cb_info_opt->queue_callback(req_id, 0, -1, 0);
return true;
}
default:
return error_and_disconnect(fmt::format("GetRoomMemberDataInternal failed with unknown error(%d)!", reply_data[0]));
}
}
vec_stream reply(reply_data, 1);
auto* resp = reply.get_flatbuffer<RoomMemberDataInternal>();
if (reply.is_error())
return error_and_disconnect("Malformed reply to GetRoomMemberDataInternal command");
u32 event_key = get_event_key();
auto& edata = allocate_req_result(event_key, SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_GetRoomMemberDataInternal, sizeof(SceNpMatching2GetRoomMemberDataInternalResponse));
auto* mdata_resp = reinterpret_cast<SceNpMatching2GetRoomMemberDataInternalResponse*>(edata.data());
auto* mdata_info = edata.allocate<SceNpMatching2RoomMemberDataInternal>(sizeof(SceNpMatching2RoomMemberDataInternal), mdata_resp->roomMemberDataInternal);
RoomMemberDataInternal_to_SceNpMatching2RoomMemberDataInternal(edata, resp, nullptr, mdata_info);
np_memory.shrink_allocation(edata.addr(), edata.size());
cb_info_opt->queue_callback(req_id, event_key, 0, edata.size());
return true;
}
u32 np_handler::set_roommemberdata_internal(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2SetRoomMemberDataInternalRequest* req)
{
u32 req_id = generate_callback_info(ctx_id, optParam, SCE_NP_MATCHING2_REQUEST_EVENT_SetRoomMemberDataInternal);
@ -512,6 +565,36 @@ namespace np
return true;
}
u32 np_handler::set_userinfo(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2SetUserInfoRequest* req)
{
u32 req_id = generate_callback_info(ctx_id, optParam, SCE_NP_MATCHING2_REQUEST_EVENT_SetUserInfo);
if (!get_rpcn()->set_userinfo(req_id, get_match2_context(ctx_id)->communicationId, req))
{
rpcn_log.error("Disconnecting from RPCN!");
is_psn_active = false;
}
return req_id;
}
bool np_handler::reply_set_userinfo(u32 req_id, std::vector<u8>& reply_data)
{
auto cb_info_opt = take_pending_request(req_id);
if (!cb_info_opt)
return true;
if (rpcn::is_error(static_cast<rpcn::ErrorType>(reply_data[0])))
{
return error_and_disconnect(fmt::format("SetUserInfo failed with unknown error(%d)!", reply_data[0]));
}
cb_info_opt->queue_callback(req_id, 0, 0, 0);
return true;
}
u32 np_handler::get_ping_info(SceNpMatching2ContextId ctx_id, vm::cptr<SceNpMatching2RequestOptParam> optParam, const SceNpMatching2SignalingGetPingInfoRequest* req)
{
u32 req_id = generate_callback_info(ctx_id, optParam, SCE_NP_MATCHING2_REQUEST_EVENT_SignalingGetPingInfo);

View File

@ -332,6 +332,18 @@ namespace extra_nps
sceNp2.warning("ownerPrivilegeRankNum: %d", req->ownerPrivilegeRankNum);
}
void print_get_roommemberdata_int_req(const SceNpMatching2GetRoomMemberDataInternalRequest* req)
{
sceNp2.warning("SceNpMatching2GetRoomMemberDataInternalRequest:");
sceNp2.warning("roomId: %d", req->roomId);
sceNp2.warning("memberId: %d", req->memberId);
sceNp2.warning("attrIdNum: %d", req->attrIdNum);
for (u32 i = 0; i < req->attrIdNum; i++)
{
sceNp2.warning("attrId[%d] = %d", i, req->attrId[i]);
}
}
void print_set_roommemberdata_int_req(const SceNpMatching2SetRoomMemberDataInternalRequest* req)
{
sceNp2.warning("SceNpMatching2SetRoomMemberDataInternalRequest:");

View File

@ -20,6 +20,7 @@ namespace extra_nps
void print_search_room_resp(const SceNpMatching2SearchRoomResponse* resp);
void print_set_roomdata_ext_req(const SceNpMatching2SetRoomDataExternalRequest* req);
void print_set_roomdata_int_req(const SceNpMatching2SetRoomDataInternalRequest* req);
void print_get_roommemberdata_int_req(const SceNpMatching2GetRoomMemberDataInternalRequest* req);
void print_set_roommemberdata_int_req(const SceNpMatching2SetRoomMemberDataInternalRequest* req);
void print_get_roomdata_external_list_req(const SceNpMatching2GetRoomDataExternalListRequest* req);
void print_get_roomdata_external_list_resp(const SceNpMatching2GetRoomDataExternalListResponse* resp);

View File

@ -84,7 +84,7 @@ namespace rpcn
rpcn_log.notice("online: %s, pr_com_id: %s, pr_title: %s, pr_status: %s, pr_comment: %s, pr_data: %s", online ? "true" : "false", pr_com_id.data, pr_title, pr_status, pr_comment, fmt::buf_to_hexstring(pr_data.data(), pr_data.size()));
}
constexpr u32 RPCN_PROTOCOL_VERSION = 21;
constexpr u32 RPCN_PROTOCOL_VERSION = 22;
constexpr usz RPCN_HEADER_SIZE = 15;
bool is_error(ErrorType err)
@ -1705,6 +1705,26 @@ namespace rpcn
return forge_request_with_com_id(builder, communication_id, CommandType::SetRoomDataInternal, req_id);
}
bool rpcn_client::get_roommemberdata_internal(u32 req_id, const SceNpCommunicationId& communication_id, const SceNpMatching2GetRoomMemberDataInternalRequest* req)
{
flatbuffers::FlatBufferBuilder builder(1024);
flatbuffers::Offset<flatbuffers::Vector<u16>> final_attrid_vec;
if (req->attrIdNum)
{
std::vector<u16> attrid_vec;
for (u32 i = 0; i < req->attrIdNum; i++)
{
attrid_vec.push_back(req->attrId[i]);
}
final_attrid_vec = builder.CreateVector(attrid_vec);
}
auto req_finished = CreateGetRoomMemberDataInternalRequest(builder, req->roomId, req->memberId, final_attrid_vec);
builder.Finish(req_finished);
return forge_request_with_com_id(builder, communication_id, CommandType::GetRoomMemberDataInternal, req_id);
}
bool rpcn_client::set_roommemberdata_internal(u32 req_id, const SceNpCommunicationId& communication_id, const SceNpMatching2SetRoomMemberDataInternalRequest* req)
{
flatbuffers::FlatBufferBuilder builder(1024);
@ -1726,6 +1746,27 @@ namespace rpcn
return forge_request_with_com_id(builder, communication_id, CommandType::SetRoomMemberDataInternal, req_id);
}
bool rpcn_client::set_userinfo(u32 req_id, const SceNpCommunicationId& communication_id, const SceNpMatching2SetUserInfoRequest* req)
{
flatbuffers::FlatBufferBuilder builder(1024);
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<BinAttr>>> final_memberbinattr_vec;
if (req->userBinAttrNum)
{
std::vector<flatbuffers::Offset<BinAttr>> davec;
for (u32 i = 0; i < req->userBinAttrNum; i++)
{
auto bin = CreateBinAttr(builder, req->userBinAttr[i].id, builder.CreateVector(req->userBinAttr[i].ptr.get_ptr(), req->userBinAttr[i].size));
davec.push_back(bin);
}
final_memberbinattr_vec = builder.CreateVector(davec);
}
auto req_finished = CreateSetUserInfo(builder, req->serverId, final_memberbinattr_vec);
builder.Finish(req_finished);
return forge_request_with_com_id(builder, communication_id, CommandType::SetUserInfo, req_id);
}
bool rpcn_client::ping_room_owner(u32 req_id, const SceNpCommunicationId& communication_id, u64 room_id)
{
std::vector<u8> data(COMMUNICATION_ID_SIZE + sizeof(u64));

View File

@ -192,7 +192,9 @@ namespace rpcn
SetRoomDataExternal,
GetRoomDataInternal,
SetRoomDataInternal,
GetRoomMemberDataInternal,
SetRoomMemberDataInternal,
SetUserInfo,
PingRoomOwner,
SendRoomMessage,
RequestSignalingInfos,
@ -461,7 +463,9 @@ namespace rpcn
bool set_roomdata_external(u32 req_id, const SceNpCommunicationId& communication_id, const SceNpMatching2SetRoomDataExternalRequest* req);
bool get_roomdata_internal(u32 req_id, const SceNpCommunicationId& communication_id, const SceNpMatching2GetRoomDataInternalRequest* req);
bool set_roomdata_internal(u32 req_id, const SceNpCommunicationId& communication_id, const SceNpMatching2SetRoomDataInternalRequest* req);
bool get_roommemberdata_internal(u32 req_id, const SceNpCommunicationId& communication_id, const SceNpMatching2GetRoomMemberDataInternalRequest* req);
bool set_roommemberdata_internal(u32 req_id, const SceNpCommunicationId& communication_id, const SceNpMatching2SetRoomMemberDataInternalRequest* req);
bool set_userinfo(u32 req_id, const SceNpCommunicationId& communication_id, const SceNpMatching2SetUserInfoRequest* req);
bool ping_room_owner(u32 req_id, const SceNpCommunicationId& communication_id, u64 room_id);
bool send_room_message(u32 req_id, const SceNpCommunicationId& communication_id, const SceNpMatching2SendRoomMessageRequest* req);
bool req_sign_infos(u32 req_id, const std::string& npid);