Merge pull request #1 from RPCS3/master

Sync PR
This commit is contained in:
Tuna Celik 2026-01-29 10:54:42 +01:00 committed by GitHub
commit 28e0b93826
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 1284 additions and 200 deletions

View File

@ -2228,6 +2228,12 @@ error_code cellFontStatic()
return CELL_OK;
}
error_code cellFontsetUSleep()
{
cellFont.todo("cellFontsetUSleep()");
return CELL_OK;
}
DECLARE(ppu_module_manager::cellFont)("cellFont", []()
{
@ -2315,4 +2321,5 @@ DECLARE(ppu_module_manager::cellFont)("cellFont", []()
REG_FUNC(cellFont, cellFontGraphicsGetLineRGBA);
REG_FUNC(cellFont, cellFontControl);
REG_FUNC(cellFont, cellFontStatic);
REG_FUNC(cellFont, cellFontsetUSleep);
});

View File

@ -1034,6 +1034,18 @@ s32 cellFsUnregisterL10nCallbacks()
return CELL_OK;
}
s32 cellFsGetDirent()
{
cellFs.todo("cellFsGetDirent()");
return CELL_OK;
}
s32 cellFsGetDirentCount()
{
cellFs.todo("cellFsGetDirentCount()");
return CELL_OK;
}
DECLARE(ppu_module_manager::cellFs)("sys_fs", []()
{
REG_FUNC(sys_fs, cellFsAccess);
@ -1065,6 +1077,8 @@ DECLARE(ppu_module_manager::cellFs)("sys_fs", []()
REG_FUNC(sys_fs, cellFsGetBlockSize);
REG_FUNC(sys_fs, cellFsGetBlockSize2);
REG_FUNC(sys_fs, cellFsGetDirectoryEntries);
REG_FUNC(sys_fs, cellFsGetDirent);
REG_FUNC(sys_fs, cellFsGetDirentCount);
REG_FUNC(sys_fs, cellFsGetFreeSize);
REG_FUNC(sys_fs, cellFsGetPath);
REG_FUNC(sys_fs, cellFsLink);

View File

@ -2514,6 +2514,18 @@ error_code cellSaveDataUserFixedDelete(ppu_thread& ppu, u32 userId, PSetList set
return savedata_op(ppu, SAVEDATA_OP_FIXED_DELETE, 0, vm::null, 1, setList, setBuf, vm::null, funcFixed, vm::null, vm::null, container, 6, userdata, userId, funcDone);
}
error_code cellSaveDataGetEnableOverlay()
{
cellSaveData.todo("cellSaveDataGetEnableOverlay()");
// auto& manager = g_fxo->get<savedata_manager>();
// manager.enable_overlay;
// TODO
return CELL_OK;
}
void cellSaveDataEnableOverlay(s32 enable)
{
cellSaveData.notice("cellSaveDataEnableOverlay(enable=%d)", enable);
@ -2521,7 +2533,6 @@ void cellSaveDataEnableOverlay(s32 enable)
manager.enable_overlay = enable != 0;
}
// Functions (Extensions)
error_code cellSaveDataListDelete(ppu_thread& ppu, PSetList setList, PSetBuf setBuf, PFuncList funcList, PFuncDone funcDone, u32 container, vm::ptr<void> userdata)
{
@ -2678,6 +2689,7 @@ void cellSysutil_SaveData_init()
REG_VAR(cellSysutil, g_savedata_context).flag(MFF_HIDDEN);
// libsysutil functions:
REG_FUNC(cellSysutil, cellSaveDataGetEnableOverlay);
REG_FUNC(cellSysutil, cellSaveDataEnableOverlay);
REG_FUNC(cellSysutil, cellSaveDataDelete2);

View File

@ -1438,6 +1438,13 @@ s32 cellSpursInitializeWithAttribute2(ppu_thread& ppu, vm::ptr<CellSpurs> spurs,
attr->swlIsPreem);
}
// Initialise SPURS
s32 cellSpursInitializeForSpuSharing()
{
cellSpurs.todo("cellSpursInitializeForSpuSharing()");
return CELL_OK;
}
/// Initialise SPURS attribute
s32 _cellSpursAttributeInitialize(vm::ptr<CellSpursAttribute> attr, u32 revision, u32 sdkVersion, u32 nSpus, s32 spuPriority, s32 ppuPriority, b8 exitIfNoWork)
{
@ -5390,6 +5397,7 @@ DECLARE(ppu_module_manager::cellSpurs)("cellSpurs", [](ppu_static_module* _this)
REG_FUNC(cellSpurs, cellSpursInitialize);
REG_FUNC(cellSpurs, cellSpursInitializeWithAttribute);
REG_FUNC(cellSpurs, cellSpursInitializeWithAttribute2);
REG_FUNC(cellSpurs, cellSpursInitializeForSpuSharing);
REG_FUNC(cellSpurs, cellSpursFinalize);
REG_FUNC(cellSpurs, _cellSpursAttributeInitialize);
REG_FUNC(cellSpurs, cellSpursAttributeSetMemoryContainerForSpuThread);

View File

@ -406,6 +406,30 @@ error_code cellSysmoduleIsLoadedEx()
return CELL_OK;
}
error_code cellSysmoduleLoadModuleFile()
{
UNIMPLEMENTED_FUNC(cellSysmodule);
return CELL_OK;
}
error_code cellSysmoduleUnloadModuleFile()
{
UNIMPLEMENTED_FUNC(cellSysmodule);
return CELL_OK;
}
error_code cellSysmoduleSetDebugmode()
{
UNIMPLEMENTED_FUNC(cellSysmodule);
return CELL_OK;
}
error_code cellSysmoduleSetInternalmode()
{
UNIMPLEMENTED_FUNC(cellSysmodule);
return CELL_OK;
}
DECLARE(ppu_module_manager::cellSysmodule)("cellSysmodule", []()
{
REG_FUNC(cellSysmodule, cellSysmoduleInitialize);
@ -421,4 +445,8 @@ DECLARE(ppu_module_manager::cellSysmodule)("cellSysmodule", []()
REG_FUNC(cellSysmodule, cellSysmoduleUnloadModuleEx);
REG_FUNC(cellSysmodule, cellSysmoduleLoadModuleEx);
REG_FUNC(cellSysmodule, cellSysmoduleIsLoadedEx);
REG_FUNC(cellSysmodule, cellSysmoduleLoadModuleFile);
REG_FUNC(cellSysmodule, cellSysmoduleUnloadModuleFile);
REG_FUNC(cellSysmodule, cellSysmoduleSetDebugmode);
REG_FUNC(cellSysmodule, cellSysmoduleSetInternalmode);
});

View File

@ -1118,10 +1118,35 @@ error_code sceNpBasicSetPresenceDetails2(vm::cptr<SceNpBasicPresenceDetails2> pr
return CELL_OK;
}
error_code sceNpBasicSendMessage(vm::cptr<SceNpId> to, vm::cptr<void> data, u32 size)
{
sceNp.warning("sceNpBasicSendMessage(to=*0x%x, data=*0x%x, size=%d)", to, data, size);
u64 sys_time_get_system_time();
error_code acquire_time_slot(u64* time_array, usz array_size, u64 slot_duration)
{
static shared_mutex mutex;
std::lock_guard lock(mutex);
const u64 current_time = sys_time_get_system_time();
for (usz index = 0; index < array_size; index++)
{
if (time_array[index] == 0)
{
time_array[index] = current_time;
return CELL_OK;
}
if (current_time > (time_array[index] + slot_duration))
{
time_array[index] = current_time;
return CELL_OK;
}
}
return SCE_NP_BASIC_ERROR_BUSY;
}
error_code _sceNpBasicSendMessage(vm::cptr<SceNpId> to, vm::cptr<void> data, u32 size, bool rate_limited)
{
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
if (!nph.is_NP_init)
@ -1144,6 +1169,22 @@ error_code sceNpBasicSendMessage(vm::cptr<SceNpId> to, vm::cptr<void> data, u32
return SCE_NP_BASIC_ERROR_EXCEEDS_MAX;
}
if (rate_limited)
{
struct sceNpBasicSendMessage_time_slots
{
sceNpBasicSendMessage_time_slots(sceNpBasicSendMessage_time_slots&&) = delete;
std::array<u64, 20> data{};
};
auto& time_slots = g_fxo->get<sceNpBasicSendMessage_time_slots>();
if (auto error = acquire_time_slot(time_slots.data.data(), time_slots.data.size(), 60000000); error != CELL_OK)
{
return error;
}
}
if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE)
{
return not_an_error(SCE_NP_BASIC_ERROR_NOT_CONNECTED);
@ -1164,6 +1205,19 @@ error_code sceNpBasicSendMessage(vm::cptr<SceNpId> to, vm::cptr<void> data, u32
return CELL_OK;
}
error_code sceNpBasicSendMessage(vm::cptr<SceNpId> to, vm::cptr<void> data, u32 size)
{
sceNp.warning("sceNpBasicSendMessage(to=*0x%x, data=*0x%x, size=%d)", to, data, size);
return _sceNpBasicSendMessage(to, data, size, false);
}
// This function is sceNpBasicSendMessage + a rate limiter that will return SCE_NP_BASIC_ERROR_BUSY if it too many messages have been sent
error_code sceNpBasicLimited_0xEB42E2E6(vm::cptr<SceNpId> to, vm::cptr<void> data, u32 size)
{
sceNp.warning("sceNpBasicLimited_0xEB42E2E6(to=*0x%x, data=*0x%x, size=%d)", to, data, size);
return _sceNpBasicSendMessage(to, data, size, true);
}
error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptr<SceNpBasicMessageDetails> msg, sys_memory_container_t containerId)
{
sceNp.warning("sceNpBasicSendMessageGui(msg=*0x%x, containerId=%d)", msg, containerId);
@ -7289,6 +7343,11 @@ s32 _Z32_sce_np_sysutil_cxml_prepare_docPN16sysutil_cxmlutil11FixedMemoryERN4cxm
return CELL_OK;
}
DECLARE(ppu_module_manager::sceNpBasicLimited)
("sceNpBasicLimited", []() {
ppu_module_manager::register_static_function<&sceNpBasicLimited_0xEB42E2E6>("sceNpBasicLimited", ppu_select_name("sceNpBasicLimited", "sceNpBasicLimited_0xEB42E2E6"), BIND_FUNC_WITH_BLR(sceNpBasicLimited_0xEB42E2E6, "sceNpBasicLimited"), 0xEB42E2E6);
});
DECLARE(ppu_module_manager::sceNp)
("sceNp", []() {
REG_FUNC(sceNp, sceNpInit);

View File

@ -616,9 +616,9 @@ error_code sceNpMatching2CreateServerContext(
return CELL_OK;
}
error_code sceNpMatching2GetMemoryInfo(vm::ptr<SceNpMatching2MemoryInfo> memInfo) // TODO
error_code sceNpMatching2GetMemoryInfo(vm::ptr<SceNpMatching2MemoryInfo> memInfo)
{
sceNp2.todo("sceNpMatching2GetMemoryInfo(memInfo=*0x%x)", memInfo);
sceNp2.warning("sceNpMatching2GetMemoryInfo(memInfo=*0x%x)", memInfo);
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
@ -627,6 +627,14 @@ error_code sceNpMatching2GetMemoryInfo(vm::ptr<SceNpMatching2MemoryInfo> memInfo
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
}
if (!memInfo)
{
return SCE_NP_MATCHING2_ERROR_INVALID_ARGUMENT;
}
SceNpMatching2MemoryInfo mem_info = nph.get_memory_info();
*memInfo = mem_info;
return CELL_OK;
}
@ -1056,7 +1064,7 @@ error_code sceNpMatching2GetRoomMemberDataInternalLocal(SceNpMatching2ContextId
error_code sceNpMatching2GetCbQueueInfo(SceNpMatching2ContextId ctxId, vm::ptr<SceNpMatching2CbQueueInfo> queueInfo)
{
sceNp2.todo("sceNpMatching2GetCbQueueInfo(ctxId=%d, queueInfo=*0x%x)", ctxId, queueInfo);
sceNp2.warning("sceNpMatching2GetCbQueueInfo(ctxId=%d, queueInfo=*0x%x)", ctxId, queueInfo);
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
@ -1065,6 +1073,17 @@ error_code sceNpMatching2GetCbQueueInfo(SceNpMatching2ContextId ctxId, vm::ptr<S
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
}
if (!queueInfo)
{
return SCE_NP_MATCHING2_ERROR_INVALID_ARGUMENT;
}
*queueInfo = {};
// TODO: check the values returned on real hardware
queueInfo->requestCbQueueLen = 255;
queueInfo->sessionEventCbQueueLen = 255;
queueInfo->sessionMsgCbQueueLen = 255;
return CELL_OK;
}
@ -1335,6 +1354,30 @@ error_code sceNpMatching2GetSignalingOptParamLocal(SceNpMatching2ContextId ctxId
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
}
if (!ctxId)
{
return SCE_NP_MATCHING2_ERROR_INVALID_CONTEXT_ID;
}
if (!roomId)
{
return SCE_NP_MATCHING2_ERROR_INVALID_ROOM_ID;
}
if (!check_match2_context(ctxId))
{
return SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_FOUND;
}
const auto [error, signaling_opt_param] = nph.local_get_signaling_opt_param(roomId);
if (error)
{
return error;
}
*signalingOptParam = *signaling_opt_param;
return CELL_OK;
}

View File

@ -1529,6 +1529,11 @@ error_code sceNpTrophyGetTrophyIcon(u32 context, u32 handle, s32 trophyId, vm::p
return CELL_OK;
}
error_code sceNpTrophyNetworkSync()
{
UNIMPLEMENTED_FUNC(sceNpTrophy);
return CELL_OK;
}
DECLARE(ppu_module_manager::sceNpTrophy)("sceNpTrophy", []()
{
@ -1553,4 +1558,5 @@ DECLARE(ppu_module_manager::sceNpTrophy)("sceNpTrophy", []()
REG_FUNC(sceNpTrophy, sceNpTrophyGetTrophyDetails);
REG_FUNC(sceNpTrophy, sceNpTrophyGetTrophyInfo);
REG_FUNC(sceNpTrophy, sceNpTrophyGetGameIcon);
REG_FUNC(sceNpTrophy, sceNpTrophyNetworkSync);
});

View File

@ -65,7 +65,7 @@ struct sce_np_util_manager
error_code sceNpUtilBandwidthTestInitStart([[maybe_unused]] ppu_thread& ppu, u32 prio, u32 stack)
{
sceNpUtil.todo("sceNpUtilBandwidthTestInitStart(prio=%d, stack=%d)", prio, stack);
sceNpUtil.warning("sceNpUtilBandwidthTestInitStart(prio=%d, stack=%d)", prio, stack);
auto& util_manager = g_fxo->get<sce_np_util_manager>();
std::lock_guard lock(util_manager.mtx);

View File

@ -314,6 +314,7 @@ static void ppu_initialize_modules(ppu_linkage_info* link, utils::serial* ar = n
&ppu_module_manager::libsnd3,
&ppu_module_manager::libsynth2,
&ppu_module_manager::sceNp,
&ppu_module_manager::sceNpBasicLimited,
&ppu_module_manager::sceNp2,
&ppu_module_manager::sceNpClans,
&ppu_module_manager::sceNpCommerce2,

View File

@ -283,6 +283,7 @@ public:
static const ppu_static_module libsnd3;
static const ppu_static_module libsynth2;
static const ppu_static_module sceNp;
static const ppu_static_module sceNpBasicLimited;
static const ppu_static_module sceNp2;
static const ppu_static_module sceNpClans;
static const ppu_static_module sceNpCommerce2;

View File

@ -2555,7 +2555,8 @@ inline constexpr JoinRoomResponse::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept
: _cached_size_{0},
signaling_data_{},
room_data_{nullptr} {}
room_data_{nullptr},
opt_param_{nullptr} {}
template <typename>
PROTOBUF_CONSTEXPR JoinRoomResponse::JoinRoomResponse(::_pbi::ConstantInitialized)
@ -2576,6 +2577,32 @@ struct JoinRoomResponseDefaultTypeInternal {
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 JoinRoomResponseDefaultTypeInternal _JoinRoomResponse_default_instance_;
inline constexpr CreateRoomResponse::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept
: _cached_size_{0},
internal_{nullptr},
opt_param_{nullptr} {}
template <typename>
PROTOBUF_CONSTEXPR CreateRoomResponse::CreateRoomResponse(::_pbi::ConstantInitialized)
#if defined(PROTOBUF_CUSTOM_VTABLE)
: ::google::protobuf::MessageLite(CreateRoomResponse_class_data_.base()),
#else // PROTOBUF_CUSTOM_VTABLE
: ::google::protobuf::MessageLite(),
#endif // PROTOBUF_CUSTOM_VTABLE
_impl_(::_pbi::ConstantInitialized()) {
}
struct CreateRoomResponseDefaultTypeInternal {
PROTOBUF_CONSTEXPR CreateRoomResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~CreateRoomResponseDefaultTypeInternal() {}
union {
CreateRoomResponse _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CreateRoomResponseDefaultTypeInternal _CreateRoomResponse_default_instance_;
} // namespace np2_structs
namespace np2_structs {
// ===================================================================
@ -11934,6 +11961,324 @@ void CreateJoinRoomRequest::InternalSwap(CreateJoinRoomRequest* PROTOBUF_RESTRIC
// ===================================================================
class CreateRoomResponse::_Internal {
public:
using HasBits =
decltype(::std::declval<CreateRoomResponse>()._impl_._has_bits_);
static constexpr ::int32_t kHasBitsOffset =
8 * PROTOBUF_FIELD_OFFSET(CreateRoomResponse, _impl_._has_bits_);
};
CreateRoomResponse::CreateRoomResponse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
#if defined(PROTOBUF_CUSTOM_VTABLE)
: ::google::protobuf::MessageLite(arena, CreateRoomResponse_class_data_.base()) {
#else // PROTOBUF_CUSTOM_VTABLE
: ::google::protobuf::MessageLite(arena) {
#endif // PROTOBUF_CUSTOM_VTABLE
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:np2_structs.CreateRoomResponse)
}
PROTOBUF_NDEBUG_INLINE CreateRoomResponse::Impl_::Impl_(
[[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
[[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from,
[[maybe_unused]] const ::np2_structs::CreateRoomResponse& from_msg)
: _has_bits_{from._has_bits_},
_cached_size_{0} {}
CreateRoomResponse::CreateRoomResponse(
::google::protobuf::Arena* PROTOBUF_NULLABLE arena,
const CreateRoomResponse& from)
#if defined(PROTOBUF_CUSTOM_VTABLE)
: ::google::protobuf::MessageLite(arena, CreateRoomResponse_class_data_.base()) {
#else // PROTOBUF_CUSTOM_VTABLE
: ::google::protobuf::MessageLite(arena) {
#endif // PROTOBUF_CUSTOM_VTABLE
CreateRoomResponse* const _this = this;
(void)_this;
_internal_metadata_.MergeFrom<::std::string>(
from._internal_metadata_);
new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from);
::uint32_t cached_has_bits = _impl_._has_bits_[0];
_impl_.internal_ = (CheckHasBit(cached_has_bits, 0x00000001U))
? ::google::protobuf::MessageLite::CopyConstruct(arena, *from._impl_.internal_)
: nullptr;
_impl_.opt_param_ = (CheckHasBit(cached_has_bits, 0x00000002U))
? ::google::protobuf::MessageLite::CopyConstruct(arena, *from._impl_.opt_param_)
: nullptr;
// @@protoc_insertion_point(copy_constructor:np2_structs.CreateRoomResponse)
}
PROTOBUF_NDEBUG_INLINE CreateRoomResponse::Impl_::Impl_(
[[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
[[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
: _cached_size_{0} {}
inline void CreateRoomResponse::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) {
new (&_impl_) Impl_(internal_visibility(), arena);
::memset(reinterpret_cast<char*>(&_impl_) +
offsetof(Impl_, internal_),
0,
offsetof(Impl_, opt_param_) -
offsetof(Impl_, internal_) +
sizeof(Impl_::opt_param_));
}
CreateRoomResponse::~CreateRoomResponse() {
// @@protoc_insertion_point(destructor:np2_structs.CreateRoomResponse)
SharedDtor(*this);
}
inline void CreateRoomResponse::SharedDtor(MessageLite& self) {
CreateRoomResponse& this_ = static_cast<CreateRoomResponse&>(self);
if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
this_.CheckHasBitConsistency();
}
this_._internal_metadata_.Delete<::std::string>();
ABSL_DCHECK(this_.GetArena() == nullptr);
delete this_._impl_.internal_;
delete this_._impl_.opt_param_;
this_._impl_.~Impl_();
}
inline void* PROTOBUF_NONNULL CreateRoomResponse::PlacementNew_(
const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem,
::google::protobuf::Arena* PROTOBUF_NULLABLE arena) {
return ::new (mem) CreateRoomResponse(arena);
}
constexpr auto CreateRoomResponse::InternalNewImpl_() {
return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(CreateRoomResponse),
alignof(CreateRoomResponse));
}
constexpr auto CreateRoomResponse::InternalGenerateClassData_() {
return ::google::protobuf::internal::ClassDataLite<31>{
{
&_CreateRoomResponse_default_instance_._instance,
&_table_.header,
nullptr, // OnDemandRegisterArenaDtor
nullptr, // IsInitialized
&CreateRoomResponse::MergeImpl,
::google::protobuf::MessageLite::GetNewImpl<CreateRoomResponse>(),
#if defined(PROTOBUF_CUSTOM_VTABLE)
&CreateRoomResponse::SharedDtor,
::google::protobuf::MessageLite::GetClearImpl<CreateRoomResponse>(), &CreateRoomResponse::ByteSizeLong,
&CreateRoomResponse::_InternalSerialize,
#endif // PROTOBUF_CUSTOM_VTABLE
PROTOBUF_FIELD_OFFSET(CreateRoomResponse, _impl_._cached_size_),
true,
},
"np2_structs.CreateRoomResponse",
};
}
PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::google::protobuf::internal::ClassDataLite<31> CreateRoomResponse_class_data_ =
CreateRoomResponse::InternalGenerateClassData_();
PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
CreateRoomResponse::GetClassData() const {
return CreateRoomResponse_class_data_.base();
}
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<1, 2, 2, 0, 2>
CreateRoomResponse::_table_ = {
{
PROTOBUF_FIELD_OFFSET(CreateRoomResponse, _impl_._has_bits_),
0, // no _extensions_
2, 8, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table),
4294967292, // skipmap
offsetof(decltype(_table_), field_entries),
2, // num_field_entries
2, // num_aux_entries
offsetof(decltype(_table_), aux_entries),
CreateRoomResponse_class_data_.base(),
nullptr, // post_loop_handler
::_pbi::TcParser::GenericFallbackLite, // fallback
#ifdef PROTOBUF_PREFETCH_PARSE_TABLE
::_pbi::TcParser::GetTable<::np2_structs::CreateRoomResponse>(), // to_prefetch
#endif // PROTOBUF_PREFETCH_PARSE_TABLE
}, {{
// .np2_structs.OptParam opt_param = 2;
{::_pbi::TcParser::FastMtS1,
{18, 1, 1,
PROTOBUF_FIELD_OFFSET(CreateRoomResponse, _impl_.opt_param_)}},
// .np2_structs.RoomDataInternal internal = 1;
{::_pbi::TcParser::FastMtS1,
{10, 0, 0,
PROTOBUF_FIELD_OFFSET(CreateRoomResponse, _impl_.internal_)}},
}}, {{
65535, 65535
}}, {{
// .np2_structs.RoomDataInternal internal = 1;
{PROTOBUF_FIELD_OFFSET(CreateRoomResponse, _impl_.internal_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)},
// .np2_structs.OptParam opt_param = 2;
{PROTOBUF_FIELD_OFFSET(CreateRoomResponse, _impl_.opt_param_), _Internal::kHasBitsOffset + 1, 1, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)},
}},
{{
{::_pbi::TcParser::GetTable<::np2_structs::RoomDataInternal>()},
{::_pbi::TcParser::GetTable<::np2_structs::OptParam>()},
}},
{{
}},
};
PROTOBUF_NOINLINE void CreateRoomResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:np2_structs.CreateRoomResponse)
::google::protobuf::internal::TSanWrite(&_impl_);
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
cached_has_bits = _impl_._has_bits_[0];
if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) {
if (CheckHasBit(cached_has_bits, 0x00000001U)) {
ABSL_DCHECK(_impl_.internal_ != nullptr);
_impl_.internal_->Clear();
}
if (CheckHasBit(cached_has_bits, 0x00000002U)) {
ABSL_DCHECK(_impl_.opt_param_ != nullptr);
_impl_.opt_param_->Clear();
}
}
_impl_._has_bits_.Clear();
_internal_metadata_.Clear<::std::string>();
}
#if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* PROTOBUF_NONNULL CreateRoomResponse::_InternalSerialize(
const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target,
::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) {
const CreateRoomResponse& this_ = static_cast<const CreateRoomResponse&>(base);
#else // PROTOBUF_CUSTOM_VTABLE
::uint8_t* PROTOBUF_NONNULL CreateRoomResponse::_InternalSerialize(
::uint8_t* PROTOBUF_NONNULL target,
::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const {
const CreateRoomResponse& this_ = *this;
#endif // PROTOBUF_CUSTOM_VTABLE
if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
this_.CheckHasBitConsistency();
}
// @@protoc_insertion_point(serialize_to_array_start:np2_structs.CreateRoomResponse)
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
cached_has_bits = this_._impl_._has_bits_[0];
// .np2_structs.RoomDataInternal internal = 1;
if (CheckHasBit(cached_has_bits, 0x00000001U)) {
target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
1, *this_._impl_.internal_, this_._impl_.internal_->GetCachedSize(), target,
stream);
}
// .np2_structs.OptParam opt_param = 2;
if (CheckHasBit(cached_has_bits, 0x00000002U)) {
target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
2, *this_._impl_.opt_param_, this_._impl_.opt_param_->GetCachedSize(), target,
stream);
}
if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
target = stream->WriteRaw(
this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).data(),
static_cast<int>(this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).size()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:np2_structs.CreateRoomResponse)
return target;
}
#if defined(PROTOBUF_CUSTOM_VTABLE)
::size_t CreateRoomResponse::ByteSizeLong(const MessageLite& base) {
const CreateRoomResponse& this_ = static_cast<const CreateRoomResponse&>(base);
#else // PROTOBUF_CUSTOM_VTABLE
::size_t CreateRoomResponse::ByteSizeLong() const {
const CreateRoomResponse& this_ = *this;
#endif // PROTOBUF_CUSTOM_VTABLE
// @@protoc_insertion_point(message_byte_size_start:np2_structs.CreateRoomResponse)
::size_t total_size = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void)cached_has_bits;
::_pbi::Prefetch5LinesFrom7Lines(&this_);
cached_has_bits = this_._impl_._has_bits_[0];
if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) {
// .np2_structs.RoomDataInternal internal = 1;
if (CheckHasBit(cached_has_bits, 0x00000001U)) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.internal_);
}
// .np2_structs.OptParam opt_param = 2;
if (CheckHasBit(cached_has_bits, 0x00000002U)) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.opt_param_);
}
}
if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
total_size += this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).size();
}
this_._impl_._cached_size_.Set(::_pbi::ToCachedSize(total_size));
return total_size;
}
void CreateRoomResponse::MergeImpl(::google::protobuf::MessageLite& to_msg,
const ::google::protobuf::MessageLite& from_msg) {
auto* const _this =
static_cast<CreateRoomResponse*>(&to_msg);
auto& from = static_cast<const CreateRoomResponse&>(from_msg);
if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
from.CheckHasBitConsistency();
}
::google::protobuf::Arena* arena = _this->GetArena();
// @@protoc_insertion_point(class_specific_merge_from_start:np2_structs.CreateRoomResponse)
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
cached_has_bits = from._impl_._has_bits_[0];
if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) {
if (CheckHasBit(cached_has_bits, 0x00000001U)) {
ABSL_DCHECK(from._impl_.internal_ != nullptr);
if (_this->_impl_.internal_ == nullptr) {
_this->_impl_.internal_ = ::google::protobuf::MessageLite::CopyConstruct(arena, *from._impl_.internal_);
} else {
_this->_impl_.internal_->MergeFrom(*from._impl_.internal_);
}
}
if (CheckHasBit(cached_has_bits, 0x00000002U)) {
ABSL_DCHECK(from._impl_.opt_param_ != nullptr);
if (_this->_impl_.opt_param_ == nullptr) {
_this->_impl_.opt_param_ = ::google::protobuf::MessageLite::CopyConstruct(arena, *from._impl_.opt_param_);
} else {
_this->_impl_.opt_param_->MergeFrom(*from._impl_.opt_param_);
}
}
}
_this->_impl_._has_bits_[0] |= cached_has_bits;
_this->_internal_metadata_.MergeFrom<::std::string>(
from._internal_metadata_);
}
void CreateRoomResponse::CopyFrom(const CreateRoomResponse& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:np2_structs.CreateRoomResponse)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void CreateRoomResponse::InternalSwap(CreateRoomResponse* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) {
using ::std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
::google::protobuf::internal::memswap<
PROTOBUF_FIELD_OFFSET(CreateRoomResponse, _impl_.opt_param_)
+ sizeof(CreateRoomResponse::_impl_.opt_param_)
- PROTOBUF_FIELD_OFFSET(CreateRoomResponse, _impl_.internal_)>(
reinterpret_cast<char*>(&_impl_.internal_),
reinterpret_cast<char*>(&other->_impl_.internal_));
}
// ===================================================================
class JoinRoomRequest::_Internal {
public:
using HasBits =
@ -12451,6 +12796,9 @@ JoinRoomResponse::JoinRoomResponse(
_impl_.room_data_ = (CheckHasBit(cached_has_bits, 0x00000002U))
? ::google::protobuf::MessageLite::CopyConstruct(arena, *from._impl_.room_data_)
: nullptr;
_impl_.opt_param_ = (CheckHasBit(cached_has_bits, 0x00000004U))
? ::google::protobuf::MessageLite::CopyConstruct(arena, *from._impl_.opt_param_)
: nullptr;
// @@protoc_insertion_point(copy_constructor:np2_structs.JoinRoomResponse)
}
@ -12462,7 +12810,12 @@ PROTOBUF_NDEBUG_INLINE JoinRoomResponse::Impl_::Impl_(
inline void JoinRoomResponse::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) {
new (&_impl_) Impl_(internal_visibility(), arena);
_impl_.room_data_ = {};
::memset(reinterpret_cast<char*>(&_impl_) +
offsetof(Impl_, room_data_),
0,
offsetof(Impl_, opt_param_) -
offsetof(Impl_, room_data_) +
sizeof(Impl_::opt_param_));
}
JoinRoomResponse::~JoinRoomResponse() {
// @@protoc_insertion_point(destructor:np2_structs.JoinRoomResponse)
@ -12476,6 +12829,7 @@ inline void JoinRoomResponse::SharedDtor(MessageLite& self) {
this_._internal_metadata_.Delete<::std::string>();
ABSL_DCHECK(this_.GetArena() == nullptr);
delete this_._impl_.room_data_;
delete this_._impl_.opt_param_;
this_._impl_.~Impl_();
}
@ -12531,17 +12885,17 @@ JoinRoomResponse::GetClassData() const {
return JoinRoomResponse_class_data_.base();
}
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<1, 2, 2, 0, 2>
const ::_pbi::TcParseTable<2, 3, 3, 0, 2>
JoinRoomResponse::_table_ = {
{
PROTOBUF_FIELD_OFFSET(JoinRoomResponse, _impl_._has_bits_),
0, // no _extensions_
2, 8, // max_field_number, fast_idx_mask
3, 24, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table),
4294967292, // skipmap
4294967288, // skipmap
offsetof(decltype(_table_), field_entries),
2, // num_field_entries
2, // num_aux_entries
3, // num_field_entries
3, // num_aux_entries
offsetof(decltype(_table_), aux_entries),
JoinRoomResponse_class_data_.base(),
nullptr, // post_loop_handler
@ -12550,14 +12904,19 @@ JoinRoomResponse::_table_ = {
::_pbi::TcParser::GetTable<::np2_structs::JoinRoomResponse>(), // to_prefetch
#endif // PROTOBUF_PREFETCH_PARSE_TABLE
}, {{
// repeated .np2_structs.Matching2SignalingInfo signaling_data = 2;
{::_pbi::TcParser::FastMtR1,
{18, 0, 1,
PROTOBUF_FIELD_OFFSET(JoinRoomResponse, _impl_.signaling_data_)}},
{::_pbi::TcParser::MiniParse, {}},
// .np2_structs.RoomDataInternal room_data = 1;
{::_pbi::TcParser::FastMtS1,
{10, 1, 0,
PROTOBUF_FIELD_OFFSET(JoinRoomResponse, _impl_.room_data_)}},
// repeated .np2_structs.Matching2SignalingInfo signaling_data = 2;
{::_pbi::TcParser::FastMtR1,
{18, 0, 1,
PROTOBUF_FIELD_OFFSET(JoinRoomResponse, _impl_.signaling_data_)}},
// .np2_structs.OptParam opt_param = 3;
{::_pbi::TcParser::FastMtS1,
{26, 2, 2,
PROTOBUF_FIELD_OFFSET(JoinRoomResponse, _impl_.opt_param_)}},
}}, {{
65535, 65535
}}, {{
@ -12565,10 +12924,13 @@ JoinRoomResponse::_table_ = {
{PROTOBUF_FIELD_OFFSET(JoinRoomResponse, _impl_.room_data_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)},
// repeated .np2_structs.Matching2SignalingInfo signaling_data = 2;
{PROTOBUF_FIELD_OFFSET(JoinRoomResponse, _impl_.signaling_data_), _Internal::kHasBitsOffset + 0, 1, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)},
// .np2_structs.OptParam opt_param = 3;
{PROTOBUF_FIELD_OFFSET(JoinRoomResponse, _impl_.opt_param_), _Internal::kHasBitsOffset + 2, 2, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)},
}},
{{
{::_pbi::TcParser::GetTable<::np2_structs::RoomDataInternal>()},
{::_pbi::TcParser::GetTable<::np2_structs::Matching2SignalingInfo>()},
{::_pbi::TcParser::GetTable<::np2_structs::OptParam>()},
}},
{{
}},
@ -12581,7 +12943,7 @@ PROTOBUF_NOINLINE void JoinRoomResponse::Clear() {
(void) cached_has_bits;
cached_has_bits = _impl_._has_bits_[0];
if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) {
if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) {
if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) {
_impl_.signaling_data_.Clear();
}
@ -12589,6 +12951,10 @@ PROTOBUF_NOINLINE void JoinRoomResponse::Clear() {
ABSL_DCHECK(_impl_.room_data_ != nullptr);
_impl_.room_data_->Clear();
}
if (CheckHasBit(cached_has_bits, 0x00000004U)) {
ABSL_DCHECK(_impl_.opt_param_ != nullptr);
_impl_.opt_param_->Clear();
}
}
_impl_._has_bits_.Clear();
_internal_metadata_.Clear<::std::string>();
@ -12633,6 +12999,13 @@ PROTOBUF_NOINLINE void JoinRoomResponse::Clear() {
}
}
// .np2_structs.OptParam opt_param = 3;
if (CheckHasBit(cached_has_bits, 0x00000004U)) {
target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
3, *this_._impl_.opt_param_, this_._impl_.opt_param_->GetCachedSize(), target,
stream);
}
if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
target = stream->WriteRaw(
this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).data(),
@ -12658,7 +13031,7 @@ PROTOBUF_NOINLINE void JoinRoomResponse::Clear() {
::_pbi::Prefetch5LinesFrom7Lines(&this_);
cached_has_bits = this_._impl_._has_bits_[0];
if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) {
if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) {
// repeated .np2_structs.Matching2SignalingInfo signaling_data = 2;
if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) {
total_size += 1UL * this_._internal_signaling_data_size();
@ -12671,6 +13044,11 @@ PROTOBUF_NOINLINE void JoinRoomResponse::Clear() {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.room_data_);
}
// .np2_structs.OptParam opt_param = 3;
if (CheckHasBit(cached_has_bits, 0x00000004U)) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.opt_param_);
}
}
if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
total_size += this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).size();
@ -12694,7 +13072,7 @@ void JoinRoomResponse::MergeImpl(::google::protobuf::MessageLite& to_msg,
(void)cached_has_bits;
cached_has_bits = from._impl_._has_bits_[0];
if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) {
if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) {
if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) {
_this->_internal_mutable_signaling_data()->InternalMergeFromWithArena(
::google::protobuf::MessageLite::internal_visibility(), arena,
@ -12708,6 +13086,14 @@ void JoinRoomResponse::MergeImpl(::google::protobuf::MessageLite& to_msg,
_this->_impl_.room_data_->MergeFrom(*from._impl_.room_data_);
}
}
if (CheckHasBit(cached_has_bits, 0x00000004U)) {
ABSL_DCHECK(from._impl_.opt_param_ != nullptr);
if (_this->_impl_.opt_param_ == nullptr) {
_this->_impl_.opt_param_ = ::google::protobuf::MessageLite::CopyConstruct(arena, *from._impl_.opt_param_);
} else {
_this->_impl_.opt_param_->MergeFrom(*from._impl_.opt_param_);
}
}
}
_this->_impl_._has_bits_[0] |= cached_has_bits;
_this->_internal_metadata_.MergeFrom<::std::string>(
@ -12727,7 +13113,12 @@ void JoinRoomResponse::InternalSwap(JoinRoomResponse* PROTOBUF_RESTRICT PROTOBUF
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
_impl_.signaling_data_.InternalSwap(&other->_impl_.signaling_data_);
swap(_impl_.room_data_, other->_impl_.room_data_);
::google::protobuf::internal::memswap<
PROTOBUF_FIELD_OFFSET(JoinRoomResponse, _impl_.opt_param_)
+ sizeof(JoinRoomResponse::_impl_.opt_param_)
- PROTOBUF_FIELD_OFFSET(JoinRoomResponse, _impl_.room_data_)>(
reinterpret_cast<char*>(&_impl_.room_data_),
reinterpret_cast<char*>(&other->_impl_.room_data_));
}
// ===================================================================

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,3 @@
// Protocol Buffers definition for np2_structs
syntax = "proto3";
@ -16,71 +15,61 @@ message uint16 {
uint32 value = 1;
}
// SignalingAddr
message SignalingAddr {
bytes ip = 1;
uint16 port = 2;
}
// MatchingSignalingInfo
message MatchingSignalingInfo {
string npid = 1;
SignalingAddr addr = 2;
}
// Matching2SignalingInfo
message Matching2SignalingInfo {
uint16 member_id = 1;
SignalingAddr addr = 2;
}
// BinAttr
message BinAttr {
uint16 id = 1;
bytes data = 2;
}
// IntAttr
message IntAttr {
uint16 id = 1;
uint32 num = 2;
}
// RoomMemberBinAttrInternal
message RoomMemberBinAttrInternal {
uint64 updateDate = 1;
BinAttr data = 2;
}
// BinAttrInternal
message BinAttrInternal {
uint64 updateDate = 1;
uint16 updateMemberId = 2;
BinAttr data = 3;
}
// OptParam
message OptParam {
uint8 type = 1;
uint8 flag = 2;
uint16 hubMemberId = 3;
}
// GroupConfig
message GroupConfig {
uint32 slotNum = 1;
bytes label = 2;
bool withPassword = 3;
}
// UserInfo
message UserInfo {
string npId = 1;
string onlineName = 2;
string avatarUrl = 3;
}
// RoomMemberDataInternal
message RoomMemberDataInternal {
UserInfo userInfo = 1;
uint64 joinDate = 2;
@ -92,7 +81,6 @@ message RoomMemberDataInternal {
repeated RoomMemberBinAttrInternal roomMemberBinAttrInternal = 8;
}
// RoomGroup
message RoomGroup {
uint8 groupId = 1;
bool withPassword = 2;
@ -101,7 +89,6 @@ message RoomGroup {
uint32 curGroupMemberNum = 5;
}
// RoomDataInternal
message RoomDataInternal {
uint16 serverId = 1;
uint32 worldId = 2;
@ -116,7 +103,6 @@ message RoomDataInternal {
repeated BinAttrInternal roomBinAttrInternal = 11;
}
// RoomDataExternal
message RoomDataExternal {
uint16 serverId = 1;
uint32 worldId = 2;
@ -137,31 +123,26 @@ message RoomDataExternal {
repeated BinAttr roomBinAttrExternal = 17;
}
// IntSearchFilter
message IntSearchFilter {
uint8 searchOperator = 1;
IntAttr attr = 2;
}
// BinSearchFilter
message BinSearchFilter {
uint8 searchOperator = 1;
BinAttr attr = 2;
}
// PresenceOptionData
message PresenceOptionData {
bytes data = 1;
uint32 len = 2;
}
// RoomGroupPasswordConfig
message RoomGroupPasswordConfig {
uint8 groupId = 1;
bool withPassword = 2;
}
// SearchRoomRequest
message SearchRoomRequest {
int32 option = 1;
uint32 worldId = 2;
@ -175,14 +156,12 @@ message SearchRoomRequest {
repeated uint16 attrId = 10;
}
// SearchRoomResponse
message SearchRoomResponse {
uint32 startIndex = 1;
uint32 total = 2;
repeated RoomDataExternal rooms = 3;
}
// CreateJoinRoomRequest
message CreateJoinRoomRequest {
uint32 worldId = 1;
uint64 lobbyId = 2;
@ -203,7 +182,12 @@ message CreateJoinRoomRequest {
OptParam sigOptParam = 17;
}
// JoinRoomRequest
// Reply on creating a room
message CreateRoomResponse {
RoomDataInternal internal = 1;
OptParam opt_param = 2;
}
message JoinRoomRequest {
uint64 roomId = 1;
bytes roomPassword = 2;
@ -213,30 +197,26 @@ message JoinRoomRequest {
uint8 teamId = 6;
}
// JoinRoomResponse
message JoinRoomResponse {
RoomDataInternal room_data = 1;
repeated Matching2SignalingInfo signaling_data = 2;
OptParam opt_param = 3;
}
// LeaveRoomRequest
message LeaveRoomRequest {
uint64 roomId = 1;
PresenceOptionData optData = 2;
}
// GetRoomDataExternalListRequest
message GetRoomDataExternalListRequest {
repeated uint64 roomIds = 1;
repeated uint16 attrIds = 2;
}
// GetRoomDataExternalListResponse
message GetRoomDataExternalListResponse {
repeated RoomDataExternal rooms = 1;
}
// SetRoomDataExternalRequest
message SetRoomDataExternalRequest {
uint64 roomId = 1;
repeated IntAttr roomSearchableIntAttrExternal = 2;
@ -244,7 +224,6 @@ message SetRoomDataExternalRequest {
repeated BinAttr roomBinAttrExternal = 4;
}
// SetRoomDataInternalRequest
message SetRoomDataInternalRequest {
uint64 roomId = 1;
uint32 flagFilter = 2;
@ -255,14 +234,12 @@ message SetRoomDataInternalRequest {
repeated uint16 ownerPrivilegeRank = 7;
}
// GetRoomMemberDataInternalRequest
message GetRoomMemberDataInternalRequest {
uint64 roomId = 1;
uint16 memberId = 2;
repeated uint16 attrId = 3;
}
// SetRoomMemberDataInternalRequest
message SetRoomMemberDataInternalRequest {
uint64 roomId = 1;
uint16 memberId = 2;
@ -270,40 +247,34 @@ message SetRoomMemberDataInternalRequest {
repeated BinAttr roomMemberBinAttrInternal = 4;
}
// SetUserInfo
message SetUserInfo {
uint16 serverId = 1;
repeated BinAttr userBinAttr = 2;
}
// GetRoomDataInternalRequest
message GetRoomDataInternalRequest {
uint64 roomId = 1;
repeated uint16 attrId = 2;
}
// RoomMemberUpdateInfo
message RoomMemberUpdateInfo {
RoomMemberDataInternal roomMemberDataInternal = 1;
uint8 eventCause = 2;
PresenceOptionData optData = 3;
}
// NotificationUserJoinedRoom
message NotificationUserJoinedRoom {
uint64 room_id = 1;
RoomMemberUpdateInfo update_info = 2;
SignalingAddr signaling = 3;
}
// RoomUpdateInfo
message RoomUpdateInfo {
uint8 eventCause = 1;
int32 errorCode = 2;
PresenceOptionData optData = 3;
}
// RoomDataInternalUpdateInfo
message RoomDataInternalUpdateInfo {
RoomDataInternal newRoomDataInternal = 1;
uint32 prevFlagAttr = 2;
@ -312,7 +283,6 @@ message RoomDataInternalUpdateInfo {
repeated uint16 newRoomBinAttrInternal = 5;
}
// RoomMemberDataInternalUpdateInfo
message RoomMemberDataInternalUpdateInfo {
RoomMemberDataInternal newRoomMemberDataInternal = 1;
uint32 prevFlagAttr = 2;
@ -320,7 +290,6 @@ message RoomMemberDataInternalUpdateInfo {
repeated uint16 newRoomMemberBinAttrInternal = 4;
}
// GetPingInfoResponse
message GetPingInfoResponse {
uint16 serverId = 1;
uint32 worldId = 2;
@ -328,7 +297,6 @@ message GetPingInfoResponse {
uint32 rtt = 4;
}
// SendRoomMessageRequest
message SendRoomMessageRequest {
uint64 roomId = 1;
uint8 castType = 2;
@ -337,7 +305,6 @@ message SendRoomMessageRequest {
uint8 option = 5;
}
// RoomMessageInfo
message RoomMessageInfo {
bool filtered = 1;
uint8 castType = 2;
@ -346,7 +313,6 @@ message RoomMessageInfo {
bytes msg = 5;
}
// MessageDetails
message MessageDetails {
string communicationId = 1;
uint64 msgId = 2;
@ -358,13 +324,11 @@ message MessageDetails {
bytes data = 8;
}
// SendMessageRequest
message SendMessageRequest {
bytes message = 1;
repeated string npids = 2;
}
// BoardInfo
message BoardInfo {
uint32 rankLimit = 1;
uint32 updateMode = 2;
@ -373,7 +337,6 @@ message BoardInfo {
uint32 uploadSizeLimit = 5;
}
// RecordScoreRequest
message RecordScoreRequest {
uint32 boardId = 1;
int32 pcId = 2;
@ -382,7 +345,6 @@ message RecordScoreRequest {
bytes data = 5;
}
// GetScoreRangeRequest
message GetScoreRangeRequest {
uint32 boardId = 1;
uint32 startRank = 2;
@ -391,13 +353,11 @@ message GetScoreRangeRequest {
bool withGameInfo = 5;
}
// ScoreNpIdPcId
message ScoreNpIdPcId {
string npid = 1;
int32 pcId = 2;
}
// GetScoreNpIdRequest
message GetScoreNpIdRequest {
uint32 boardId = 1;
repeated ScoreNpIdPcId npids = 2;
@ -405,7 +365,6 @@ message GetScoreNpIdRequest {
bool withGameInfo = 4;
}
// GetScoreFriendsRequest
message GetScoreFriendsRequest {
uint32 boardId = 1;
bool include_self = 2;
@ -414,7 +373,6 @@ message GetScoreFriendsRequest {
bool withGameInfo = 5;
}
// ScoreRankData
message ScoreRankData {
string npId = 1;
string onlineName = 2;
@ -425,12 +383,10 @@ message ScoreRankData {
uint64 recordDate = 7;
}
// ScoreInfo
message ScoreInfo {
bytes data = 1;
}
// GetScoreResponse
message GetScoreResponse {
repeated ScoreRankData rankArray = 1;
repeated string commentArray = 2;
@ -439,27 +395,23 @@ message GetScoreResponse {
uint32 totalRecord = 5;
}
// RecordScoreGameDataRequest
message RecordScoreGameDataRequest {
uint32 boardId = 1;
int32 pcId = 2;
int64 score = 3;
}
// GetScoreGameDataRequest
message GetScoreGameDataRequest {
uint32 boardId = 1;
string npId = 2;
int32 pcId = 3;
}
// TusUser
message TusUser {
bool vuser = 1;
string npid = 2;
}
// TusVariable
message TusVariable {
string ownerId = 1;
bool hasData = 2;
@ -469,31 +421,26 @@ message TusVariable {
int64 oldVariable = 6;
}
// TusVarResponse
message TusVarResponse {
repeated TusVariable vars = 1;
}
// TusSetMultiSlotVariableRequest
message TusSetMultiSlotVariableRequest {
TusUser user = 1;
repeated int32 slotIdArray = 2;
repeated int64 variableArray = 3;
}
// TusGetMultiSlotVariableRequest
message TusGetMultiSlotVariableRequest {
TusUser user = 1;
repeated int32 slotIdArray = 2;
}
// TusGetMultiUserVariableRequest
message TusGetMultiUserVariableRequest {
repeated TusUser users = 1;
int32 slotId = 2;
}
// TusGetFriendsVariableRequest
message TusGetFriendsVariableRequest {
int32 slotId = 1;
bool includeSelf = 2;
@ -501,7 +448,6 @@ message TusGetFriendsVariableRequest {
uint32 arrayNum = 4;
}
// TusAddAndGetVariableRequest
message TusAddAndGetVariableRequest {
TusUser user = 1;
int32 slotId = 2;
@ -510,7 +456,6 @@ message TusAddAndGetVariableRequest {
string isLastChangedAuthorId = 5;
}
// TusTryAndSetVariableRequest
message TusTryAndSetVariableRequest {
TusUser user = 1;
int32 slotId = 2;
@ -521,13 +466,11 @@ message TusTryAndSetVariableRequest {
repeated int64 compareValue = 7;
}
// TusDeleteMultiSlotVariableRequest
message TusDeleteMultiSlotVariableRequest {
TusUser user = 1;
repeated int32 slotIdArray = 2;
}
// TusSetDataRequest
message TusSetDataRequest {
TusUser user = 1;
int32 slotId = 2;
@ -537,7 +480,6 @@ message TusSetDataRequest {
string isLastChangedAuthorId = 6;
}
// TusDataStatus
message TusDataStatus {
string ownerId = 1;
bool hasData = 2;
@ -546,36 +488,30 @@ message TusDataStatus {
bytes info = 5;
}
// TusData
message TusData {
TusDataStatus status = 1;
bytes data = 2;
}
// TusDataStatusResponse
message TusDataStatusResponse {
repeated TusDataStatus status = 1;
}
// TusGetDataRequest
message TusGetDataRequest {
TusUser user = 1;
int32 slotId = 2;
}
// TusGetMultiSlotDataStatusRequest
message TusGetMultiSlotDataStatusRequest {
TusUser user = 1;
repeated int32 slotIdArray = 2;
}
// TusGetMultiUserDataStatusRequest
message TusGetMultiUserDataStatusRequest {
repeated TusUser users = 1;
int32 slotId = 2;
}
// TusGetFriendsDataStatusRequest
message TusGetFriendsDataStatusRequest {
int32 slotId = 1;
bool includeSelf = 2;
@ -583,13 +519,11 @@ message TusGetFriendsDataStatusRequest {
uint32 arrayNum = 4;
}
// TusDeleteMultiSlotDataRequest
message TusDeleteMultiSlotDataRequest {
TusUser user = 1;
repeated int32 slotIdArray = 2;
}
// SetPresenceRequest
message SetPresenceRequest {
string title = 1;
string status = 2;
@ -597,7 +531,6 @@ message SetPresenceRequest {
bytes data = 4;
}
// MatchingSearchCondition
message MatchingSearchCondition {
uint32 attr_type = 1;
uint32 attr_id = 2;
@ -605,7 +538,6 @@ message MatchingSearchCondition {
uint32 comp_value = 4;
}
// MatchingAttr
message MatchingAttr {
uint32 attr_type = 1;
uint32 attr_id = 2;
@ -613,7 +545,6 @@ message MatchingAttr {
bytes data = 4;
}
// CreateRoomGUIRequest
message CreateRoomGUIRequest {
uint32 total_slots = 1;
uint32 private_slots = 2;
@ -622,13 +553,11 @@ message CreateRoomGUIRequest {
repeated MatchingAttr game_attrs = 5;
}
// GUIUserInfo
message GUIUserInfo {
UserInfo info = 1;
bool owner = 2;
}
// MatchingRoomStatus
message MatchingRoomStatus {
bytes id = 1;
repeated GUIUserInfo members = 2;
@ -636,7 +565,6 @@ message MatchingRoomStatus {
bytes opt = 4;
}
// GetRoomListGUIRequest
message GetRoomListGUIRequest {
uint32 range_start = 1;
uint32 range_max = 2;
@ -644,43 +572,36 @@ message GetRoomListGUIRequest {
repeated MatchingAttr attrs = 4;
}
// MatchingRoom
message MatchingRoom {
bytes id = 1;
repeated MatchingAttr attr = 2;
}
// MatchingRoomList
message MatchingRoomList {
uint32 start = 1;
uint32 total = 2;
repeated MatchingRoom rooms = 3;
}
// MatchingGuiRoomId
message MatchingGuiRoomId {
bytes id = 1;
}
// SetRoomSearchFlagGUI
message SetRoomSearchFlagGUI {
bytes roomid = 1;
bool stealth = 2;
}
// QuickMatchGUIRequest
message QuickMatchGUIRequest {
repeated MatchingSearchCondition conds = 1;
uint32 available_num = 2;
}
// SearchJoinRoomGUIRequest
message SearchJoinRoomGUIRequest {
repeated MatchingSearchCondition conds = 1;
repeated MatchingAttr attrs = 2;
}
// MatchingSearchJoinRoomInfo
message MatchingSearchJoinRoomInfo {
MatchingRoomStatus room = 1;
repeated MatchingAttr attr = 2;

View File

@ -39,6 +39,11 @@ namespace np
m_allocs.clear();
}
std::tuple<u32, u32, u32> get_stats() const
{
return {m_size, m_size - m_avail, m_max_usage};
}
u32 allocate(u32 size)
{
std::lock_guard lock(m_mutex);
@ -82,6 +87,12 @@ namespace np
m_allocs.emplace(last_free, alloc_size);
m_avail -= alloc_size;
const u32 usage = m_size - m_avail;
if (usage > m_max_usage)
{
m_max_usage = usage;
}
memset((static_cast<u8*>(m_pool.get_ptr())) + last_free, 0, alloc_size);
np_mem_allocator.trace("Allocation off:%d size:%d psize:%d, pavail:%d", last_free, alloc_size, m_size, m_avail);
@ -121,6 +132,7 @@ namespace np
vm::ptr<void> m_pool{};
u32 m_size = 0;
u32 m_avail = 0;
u32 m_max_usage = 0;
std::map<u32, u32> m_allocs{}; // offset/size
};
} // namespace np

View File

@ -120,6 +120,11 @@ namespace np
rooms[room_id].password = password;
}
void cache_manager::update_opt_param(SceNpMatching2RoomId room_id, const SceNpMatching2SignalingOptParam* sce_opt_param)
{
rooms[room_id].opt_param = *sce_opt_param;
}
std::pair<error_code, std::optional<SceNpMatching2RoomSlotInfo>> cache_manager::get_slots(SceNpMatching2RoomId room_id)
{
std::lock_guard lock(mutex);
@ -223,6 +228,18 @@ namespace np
return {CELL_OK, rooms[room_id].password};
}
std::pair<error_code, std::optional<SceNpMatching2SignalingOptParam>> cache_manager::get_opt_param(SceNpMatching2RoomId room_id)
{
std::lock_guard lock(mutex);
if (!rooms.contains(room_id))
{
return {SCE_NP_MATCHING2_ERROR_ROOM_NOT_FOUND, {}};
}
return {CELL_OK, rooms[room_id].opt_param};
}
error_code cache_manager::get_member_and_attrs(SceNpMatching2RoomId room_id, SceNpMatching2RoomMemberId member_id, const std::vector<SceNpMatching2AttributeId>& binattrs_list, SceNpMatching2RoomMemberDataInternal* ptr_member, u32 addr_data, u32 size_data, bool include_onlinename, bool include_avatarurl)
{
std::lock_guard lock(mutex);

View File

@ -58,6 +58,8 @@ namespace np
std::map<SceNpMatching2RoomGroupId, SceNpMatching2RoomGroup> groups;
std::map<SceNpMatching2RoomMemberId, member_cache> members;
SceNpMatching2SignalingOptParam opt_param{};
bool owner = false;
};
@ -70,10 +72,12 @@ namespace np
bool add_member(SceNpMatching2RoomId room_id, const SceNpMatching2RoomMemberDataInternal* sce_roommemberdata);
bool del_member(SceNpMatching2RoomId room_id, SceNpMatching2RoomMemberId member_id);
void update_password(SceNpMatching2RoomId room_id, const std::optional<SceNpMatching2SessionPassword>& password);
void update_opt_param(SceNpMatching2RoomId room_id, const SceNpMatching2SignalingOptParam* sce_opt_param);
std::pair<error_code, std::optional<SceNpMatching2RoomSlotInfo>> get_slots(SceNpMatching2RoomId room_id);
std::pair<error_code, std::vector<SceNpMatching2RoomMemberId>> get_memberids(u64 room_id, s32 sort_method);
std::pair<error_code, std::optional<SceNpMatching2SessionPassword>> get_password(SceNpMatching2RoomId room_id);
std::pair<error_code, std::optional<SceNpMatching2SignalingOptParam>> get_opt_param(SceNpMatching2RoomId room_id);
error_code get_member_and_attrs(SceNpMatching2RoomId room_id, SceNpMatching2RoomMemberId member_id, const std::vector<SceNpMatching2AttributeId>& binattrs_list, SceNpMatching2RoomMemberDataInternal* ptr_member, u32 addr_data, u32 size_data, bool include_onlinename, bool include_avatarurl);
std::pair<error_code, std::optional<SceNpId>> get_npid(u64 room_id, u16 member_id);
std::optional<u16> get_memberid(u64 room_id, const SceNpId& npid);

View File

@ -1672,6 +1672,11 @@ namespace np
return np_cache.get_memberids(room_id, sort_method);
}
std::pair<error_code, std::optional<SceNpMatching2SignalingOptParam>> np_handler::local_get_signaling_opt_param(SceNpMatching2RoomId room_id)
{
return np_cache.get_opt_param(room_id);
}
error_code np_handler::local_get_room_member_data(SceNpMatching2RoomId room_id, SceNpMatching2RoomMemberId member_id, const std::vector<SceNpMatching2AttributeId>& binattrs_list, SceNpMatching2RoomMemberDataInternal* ptr_member, u32 addr_data, u32 size_data, u32 ctx_id)
{
auto [include_onlinename, include_avatarurl] = get_match2_context_options(ctx_id);
@ -1759,4 +1764,16 @@ namespace np
}
}
SceNpMatching2MemoryInfo np_handler::get_memory_info() const
{
auto [m_size, m_usage, m_max_usage] = np_memory.get_stats();
SceNpMatching2MemoryInfo mem_info{};
mem_info.totalMemSize = m_size;
mem_info.curMemUsage = m_usage;
mem_info.maxMemUsage = m_max_usage;
return mem_info;
}
} // namespace np

View File

@ -235,6 +235,7 @@ namespace np
std::pair<error_code, std::optional<SceNpMatching2RoomSlotInfo>> local_get_room_slots(SceNpMatching2RoomId room_id);
std::pair<error_code, std::optional<SceNpMatching2SessionPassword>> local_get_room_password(SceNpMatching2RoomId room_id);
std::pair<error_code, std::vector<SceNpMatching2RoomMemberId>> local_get_room_memberids(SceNpMatching2RoomId room_id, s32 sort_method);
std::pair<error_code, std::optional<SceNpMatching2SignalingOptParam>> local_get_signaling_opt_param(SceNpMatching2RoomId room_id);
error_code local_get_room_member_data(SceNpMatching2RoomId room_id, SceNpMatching2RoomMemberId member_id, const std::vector<SceNpMatching2AttributeId>& binattrs_list, SceNpMatching2RoomMemberDataInternal* ptr_member, u32 addr_data, u32 size_data, u32 ctx_id);
// Local GUI functions
@ -261,6 +262,7 @@ namespace np
u32 add_players_to_history(const SceNpId* npids, const char* description, u32 count);
u32 get_players_history_count(u32 options);
bool get_player_history_entry(u32 options, u32 index, SceNpId* npid);
SceNpMatching2MemoryInfo get_memory_info() const;
error_code abort_request(u32 req_id);
// For signaling

View File

@ -200,8 +200,11 @@ namespace np
return;
}
const auto resp = reply.get_protobuf<np2_structs::RoomDataInternal>();
const auto resp = reply.get_protobuf<np2_structs::CreateRoomResponse>();
ensure(!reply.is_error(), "Malformed reply to CreateRoom command");
ensure(resp->has_internal());
const auto& resp_internal = resp->internal();
const u32 event_key = get_event_key();
auto [include_onlinename, include_avatarurl] = get_match2_context_options(cb_info_opt->ctx_id);
@ -209,13 +212,19 @@ namespace np
auto& edata = allocate_req_result(event_key, SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_CreateJoinRoom, sizeof(SceNpMatching2CreateJoinRoomResponse));
auto* room_resp = reinterpret_cast<SceNpMatching2CreateJoinRoomResponse*>(edata.data());
auto* room_info = edata.allocate<SceNpMatching2RoomDataInternal>(sizeof(SceNpMatching2RoomDataInternal), room_resp->roomDataInternal);
RoomDataInternal_to_SceNpMatching2RoomDataInternal(edata, *resp, room_info, npid, include_onlinename, include_avatarurl);
RoomDataInternal_to_SceNpMatching2RoomDataInternal(edata, resp_internal, room_info, npid, include_onlinename, include_avatarurl);
np_memory.shrink_allocation(edata.addr(), edata.size());
const auto resp_opt_param = resp->opt_param();
SceNpMatching2SignalingOptParam opt_param{};
OptParam_to_SceNpMatching2SignalingOptParam(resp_opt_param, &opt_param);
np_cache.insert_room(room_info);
np_cache.update_password(room_resp->roomDataInternal->roomId, cached_cj_password);
np_cache.update_password(room_info->roomId, cached_cj_password);
np_cache.update_opt_param(room_info->roomId, &opt_param);
extra_nps::print_SceNpMatching2CreateJoinRoomResponse(room_resp);
extra_nps::print_SceNpMatching2SignalingOptParam(&opt_param);
cb_info_opt->queue_callback(req_id, event_key, 0, edata.size());
}
@ -275,36 +284,38 @@ namespace np
RoomDataInternal_to_SceNpMatching2RoomDataInternal(edata, resp->room_data(), room_info, npid, include_onlinename, include_avatarurl);
np_memory.shrink_allocation(edata.addr(), edata.size());
const u64 room_id = resp->room_data().roomid();
const auto resp_opt_param = resp->opt_param();
SceNpMatching2SignalingOptParam opt_param{};
OptParam_to_SceNpMatching2SignalingOptParam(resp_opt_param, &opt_param);
np_cache.insert_room(room_info);
np_cache.update_opt_param(room_id, &opt_param);
extra_nps::print_SceNpMatching2RoomDataInternal(room_info);
extra_nps::print_SceNpMatching2SignalingOptParam(&opt_param);
// We initiate signaling if necessary
if (resp->signaling_data_size() > 0)
for (int i = 0; i < resp->signaling_data_size(); i++)
{
const u64 room_id = resp->room_data().roomid();
const auto& signaling_info = resp->signaling_data(i);
ensure(signaling_info.has_addr());
for (int i = 0; i < resp->signaling_data_size(); i++)
{
const auto& signaling_info = resp->signaling_data(i);
ensure(signaling_info.has_addr());
const u32 addr_p2p = register_ip(signaling_info.addr().ip());
const u16 port_p2p = signaling_info.addr().port().value();
const u32 addr_p2p = register_ip(signaling_info.addr().ip());
const u16 port_p2p = signaling_info.addr().port().value();
const u16 member_id = signaling_info.member_id().value();
const auto [npid_res, npid_p2p] = np_cache.get_npid(room_id, member_id);
const u16 member_id = signaling_info.member_id().value();
const auto [npid_res, npid_p2p] = np_cache.get_npid(room_id, member_id);
if (npid_res != CELL_OK)
continue;
if (npid_res != CELL_OK)
continue;
rpcn_log.notice("JoinRoomResult told to connect to member(%d=%s) of room(%d): %s:%d", member_id, reinterpret_cast<const char*>(npid_p2p->handle.data), room_id, ip_to_string(addr_p2p), port_p2p);
rpcn_log.notice("JoinRoomResult told to connect to member(%d=%s) of room(%d): %s:%d", member_id, reinterpret_cast<const char*>(npid_p2p->handle.data), room_id, ip_to_string(addr_p2p), port_p2p);
// Attempt Signaling
auto& sigh = g_fxo->get<named_thread<signaling_handler>>();
const u32 conn_id = sigh.init_sig2(*npid_p2p, room_id, member_id);
sigh.start_sig(conn_id, addr_p2p, port_p2p);
}
// Attempt Signaling
auto& sigh = g_fxo->get<named_thread<signaling_handler>>();
const u32 conn_id = sigh.init_sig2(*npid_p2p, room_id, member_id);
sigh.start_sig(conn_id, addr_p2p, port_p2p);
}
cb_info_opt->queue_callback(req_id, event_key, 0, edata.size());

View File

@ -632,4 +632,11 @@ namespace np
MatchingAttr_to_SceNpMatchingAttr(edata, resp.attr(), room_info->attr);
}
void OptParam_to_SceNpMatching2SignalingOptParam(const np2_structs::OptParam& resp, SceNpMatching2SignalingOptParam* opt_param)
{
opt_param->type = resp.type().value();
opt_param->flag = resp.flag().value();
opt_param->hubMemberId = resp.hubmemberid().value();
}
} // namespace np

View File

@ -32,4 +32,5 @@ namespace np
void MatchingRoomList_to_SceNpMatchingRoomList(event_data& edata, const np2_structs::MatchingRoomList& resp, SceNpMatchingRoomList* room_list);
void MatchingSearchJoinRoomInfo_to_SceNpMatchingSearchJoinRoomInfo(event_data& edata, const np2_structs::MatchingSearchJoinRoomInfo& resp, SceNpMatchingSearchJoinRoomInfo* room_info);
void MatchingAttr_to_SceNpMatchingAttr(event_data& edata, const google::protobuf::RepeatedPtrField<np2_structs::MatchingAttr>& attr_list, vm::bptr<SceNpMatchingAttr>& first_attr);
void OptParam_to_SceNpMatching2SignalingOptParam(const np2_structs::OptParam& resp, SceNpMatching2SignalingOptParam* opt_param);
} // namespace np

View File

@ -256,7 +256,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 = 29;
constexpr u32 RPCN_PROTOCOL_VERSION = 30;
constexpr usz RPCN_HEADER_SIZE = 15;
const char* error_to_explanation(rpcn::ErrorType error)