Files
AnyPS5/docs/dev/debt/libSceNpMatching2.md
T
zaryabzip 078b64c6fb feat(libSceNpMatching2): answer the request checks, local and signaling calls offline as firmware 13.42 does
Firmware 13.42, run natively, checks six requests' arguments before the
context; a request that passes them still throws, because the run could
not show how the module completes it. LeaveRoom finds no session, the
local getters report the context as not started, and the signaling calls
find no peer. The signaling port is stored and reported.
2026-10-31 04:30:59 +05:00

9.2 KiB

libSceNpMatching2 technical debt

Unknown function info

Functional

  • sceNpMatching2Initialize, sceNpMatching2Terminate (libSceNpMatching2) - only the library state is kept: initialization checks the parameter's size field (0x28, or 0x30 with an SSL pool) as shadPS4 does and starts no thread; a second initialization returns ALREADY_INITIALIZED and a termination without one NOT_INITIALIZED. The pool, thread and SSL settings are not used: no matching server is reached. Not measured on a console
  • sceNpMatching2CreateContext and the context calls (libSceNpMatching2) - offline only, not measured on a PS5: the checks follow shadPS4 and its context manager (a 0x28-byte parameter, ten ids handed out round-robin). sceNpMatching2ContextStart returns 0x804101E2 (SCE_NET_ERROR_RESOLVER_ETIMEDOUT), which shadPS4 says was confirmed on a console disconnected from the internet, so no context starts and sceNpMatching2ContextStop answers CONTEXT_NOT_STARTED. Callbacks and the default request option are checked but never used. The room, user, world, server-id and signaling-info calls still throw
  • sceNpMatching2CreateContextA (libSceNpMatching2) - offline only: the A parameter (user id, service label, then a size of 0x10) and its checks follow a later shadPS4, and the user id is unused. The context takes the next of the same ten slots with 0x100 added: firmware 13.42, run natively, gave context 1 to sceNpMatching2CreateContext and 258 (0x0102) to the sceNpMatching2CreateContextA after it. That the 0x100 marks A contexts, and that slot 2 alone does not name the A context, are read from that single pair
  • sceNpMatching2RegisterLobbyEventCallback, sceNpMatching2RegisterLobbyMessageCallback (libSceNpMatching2) - offline only, not measured on a PS5: checked like the room callbacks, as shadPS4 does (event, message), and never called: no lobby is joined offline
  • sceNpMatching2SignalingGetConnectionStatus, sceNpMatching2AbortContextStart (libSceNpMatching2) - not measured on a console. With no room joined offline, the status call writes 0 (inactive) and returns 0 for a known context, as shadPS4 does; the PS3 module in RPCS3 also writes inactive but returns INVALID_ROOM_ID. A null status pointer throws (shadPS4 skips the write, RPCS3 returns INVALID_ARGUMENT); peer address and port are never written. The abort returns NOT_INITIALIZED before initialization, as RPCS3 does, and 0 for any context id, as both do
  • sceNpMatching2GetWorldInfoList, sceNpMatching2SetUserInfo, sceNpMatching2SetRoomDataExternal, sceNpMatching2SetRoomDataInternal, sceNpMatching2GetRoomDataInternal, sceNpMatching2SignalingGetPingInfo (libSceNpMatching2) - follow firmware 13.42 run natively on never-started contexts: initialization, a null parameter, then its leading server id (INVALID_SERVER_ID) or room id (INVALID_ROOM_ID) come before the context (CONTEXT_NOT_FOUND). A request that passes these checks throws: the run accepted it and handed out a request id counted from 1, but with its worker threads stopped it could not show how the module completes, calls back or cancels the request offline. Not reproduced or measured: the checks on the rest of each parameter and a null request id (refused with the parameter, as in shadPS4)
  • sceNpMatching2LeaveRoom (libSceNpMatching2) - checked like the room requests above, then returns SESSION_NOT_FOUND (0x80550C3A) on a known context and CONTEXT_NOT_FOUND on an unknown one, as firmware 13.42 did, and room 0 gives INVALID_ROOM_ID on any context
  • sceNpMatching2GetServerId, sceNpMatching2GetRoomJoinedSlotMaskLocal, sceNpMatching2GetWorldIdArrayForAllServers (libSceNpMatching2) - no context starts offline, so a known context gets what firmware 13.42 returned for a created, never-started one, writing nothing: CONTEXT_NOT_STARTED, CONTEXT_NOT_STARTED and SERVER_NOT_AVAILABLE (0x80550C28). An unknown context gives CONTEXT_NOT_FOUND. The first two refuse a null output before the context; room 0 gives 0x80550C0C on a known context (measured). The third checks the context first, then its pointers. Assumed: that initialization is checked first, as in the request calls, the widths of the third call's arguments and which of its pointers it checks
  • sceNpMatching2SignalingGetConnectionInfo, sceNpMatching2SignalingGetConnectionInfoA, sceNpMatching2SignalingGetPort, sceNpMatching2SignalingSetPort (libSceNpMatching2) - as firmware 13.42 did with no context started: the connection info calls refuse a null info with 0x80550E15, then answer 0x80550E19 (no peer) for a known context and 0x80550E05 for an unknown one; the null check of the non-A form and the answer before initialization are not measured. The signaling port starts at 0 and SetPort stores what GetPort reports. Neither checks initialization here, and GetPort writes through its pointer with no null check, as the module does per its disassembly