Repository navigation
feat(libSceNpCppWebApi): answer the SessionManager value accessors - #19526
oneandonlydean merged 8 commits into
Conversation
`libSceNpCppWebApi.prx` in Demon's Souls (PPSA01341) answers twenty-four
SessionManager members with one field read each:
FromMember::getOnlineId 0x18, 0x14 bytes
Representative::getPlatform 0x30 (String)
GameSessionPlayer::getAccountId 0x10 uint64_t
GameSessionPlayer::getPlatform 0x30 (String)
GameSessionPlayer::getJoinState / joinStateIsSet 0x78 / 0x7c
GameSessionForRead::getSessionId / sessionIdIsSet 0x10 / 0x30
GameSessionForRead::getMember / memberIsSet 0x70 / 0x88
PlayerSessionForRead::getSessionId 0x10 (String)
PlayerSessionForRead::getJoinableUserType / IsSet 0x134 / 0x138
GameSessionMemberForRead::getPlayers / playersIsSet 0x10 / 0x28
ResponsePlayerSessionInvitation::getInvitationId 0x10 (String)
UsersPlayerSessionsInvitationForRead::getSessionId 0x78 (String)
sessionIdIsSet / invitationIdIsSet 0x98 / 0x30
getFrom / fromIsSet 0x38 / 0x50
receivedTimestampIsSet 0xe0
PostPlayerSessionsSessionIdInvitationsResponseBody
getInvitations / invitationsIsSet 0x30 / 0x48
Every string member is a 0x20-byte `CommonString` and every flag sits
one member-width after the value it guards, so `getSessionId` at 0x10
paired with `sessionIdIsSet` at 0x30, `getFrom` at 0x38 paired with
`fromIsSet` at 0x50, and `getMember` at 0x70 paired with `memberIsSet`
at 0x88 each pin the layout from both ends. `getOnlineId` copies 0x14
bytes, which matches the 20-byte online id `Representative` and
`GameSessionPlayer` already return through the same helper, and their
already-answered `getAccountId` at 0x10 with `getOnlineId` at 0x18 and
`getPlatform` at 0x30 fixes the same triple this PR answers for
`GameSessionPlayer`.
Twenty declarations were wrong and are corrected here. Fifteen in the
appended block returned `int` whatever the member was; `getPlayers`,
`getInvitations` and `getFrom` also lacked the structure-return pointer
their `IntrusivePtr` result needs; `getAccountId` was 32 bits wide where
the module's `mov rax` returns 64; and `getOnlineId` and `getSessionId`
returned `const char*` pointing at the string object's head instead of
`const CommonString*`.
`GetUsersAccountIdPlayerSessionsInvitationsResponseBody::getInvitations`
and its flag are left as they are: #16018 and #16052 both touch that
symbol, so this PR stays out of their way.
`guest_np_cpp_web_api_session_manager_values` drives each accessor over
a buffer filled with `0xa5`, flips only the guarded byte for the flags,
writes a 64-bit account id and a negative join state with `0xff`
neighbours, and checks that the member copies return the three words of
the `IntrusivePtr` with the reference count incremented at 0x00 or 0x30
as the member kind requires.
The library moves from 1641 to 1665 answered symbols of the 1762 it
exports, the patched prx still exports the same 1762 NIDs, and all 18
suites of this library pass.
|
The accessors read what the table lists, with one test row per accessor. Two things need to be written down before this can go in, and the first one matters for correctness:
The same two points apply to #19481 and #19500 (Matchmaking accessors by the same author). |
…ir build The `SessionManager::V1 model accessors` entry said other model fields remain unsupported without naming what this branch answers, and it did not say which build the offsets came from. It now lists the twenty-four accessors with their offsets, says they were inspected statically and not executed, and states that they were read from the PPSA01341 v01.007.000 module. Three of them (`getMember` +0x70, `memberIsSet` +0x88, `sessionIdIsSet` +0x30) are also recorded from PPSA21564 and read identically here, so those three are confirmed on both builds. `getJoinableUserType` +0x134 and its flag sit in this class's diverging region and are called out as answering for the PPSA01341 layout, possibly wrong for a title built against the other one; the remaining nineteen have no cross-build comparison.
|
Both points are in 1. Which build, and what is confirmed across builds. The listing is from the PPSA01341 v01.007.000 module, and the entry now says so. On the other two builds: the PPSA21564 For these 24 specifically, three offsets are in that recorded set and read identically here — Your point about 2. The entry names them. It now lists all 24 with their offsets and no longer leaves them under "other model fields remain unsupported" — that sentence still refers to the fields not listed. One thing worth stating so you can check the rule I applied: I throw when the same member has two recorded offsets (that is why #19503's |
Extending the `SessionManager::V1 model accessors` entry pushed it past the 1000-character limit the conventions check warns at, so the list moves into two entries of its own: the session models and the invitation models. The first gives the fourteen session accessors with their offsets, notes that `getMember`, `memberIsSet` and `sessionIdIsSet` also appear in the offsets recorded from PPSA21564 and read identically here, and that `getJoinableUserType` and its flag sit in this class's diverging region and answer for the PPSA01341 layout only. The second gives the ten invitation accessors with theirs and says they are one-build only. Both say the offsets were read from the PPSA01341 v01.007.000 module and inspected statically rather than executed, and that other fields and console values are unverified.
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
Progress report (8c8a6a2 → 9da9aa9)📈 System libraries: 40.52% (+0.06%, +24 implemented functions) ✅ 24 implemented
Changed libraries (implemented exports)
|
The conflict is the tail of `libSceNpCppWebApi/CMakeLists.txt`, where main gained the DateTime and string blocks from the two merged PRs while this branch appends its own. All three stay and the file registers fifteen suites. `Export.cpp` and `Api.hpp` merged without help: the twenty-four accessors this branch answers are still converted, with the twenty declaration corrections this branch carries, and no implementation that main gained since is dropped. `guest_np_cpp_web_api_*` is 20 of 20 after the merge.
|
Tested
AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports. |
|
Merged The failed Thanks @ycbuzi for the full suite on |
|
The #19481 ( |
|
Merged Re-verified on the merged tree, not on the old one: The |
# Conflicts: # core/libs/prx/libSceNpCppWebApi/CMakeLists.txt
What
libSceNpCppWebApi.prxin Demon's Souls (PPSA01341) answers twenty-four SessionManager members with a single field read each. This PR replaces theirNotImplemented_nid_no_patchstubs with that read and fixes the declarations that described them wrongly.Each string member is a 0x20-byte
CommonString, and each flag sits one member-width after the value it guards, so every pair pins the layout from both ends:getSessionId0x10 withsessionIdIsSet0x30,getFrom0x38 withfromIsSet0x50,getMember0x70 withmemberIsSet0x88.getOnlineIdcopies 0x14 bytes, which is the same 20-byte online idRepresentativeandGameSessionPlayeralready return through the same helper, and those two classes already answergetAccountIdat 0x10 withgetOnlineIdat 0x18 andgetPlatformat 0x30 — the same triple this PR answers forGameSessionPlayer.Twenty declarations were wrong and are corrected here. Fifteen in the appended block returned
intwhatever the member was;getPlayers,getInvitationsandgetFromalso lacked the structure-return pointer theirIntrusivePtrresult needs;getAccountIdwas 32 bits wide where the module'smov raxreturns 64; andgetOnlineIdandgetSessionIdreturnedconst char*pointing at the string object's head instead ofconst CommonString*.GetUsersAccountIdPlayerSessionsInvitationsResponseBody::getInvitationsand its flag are left out of this PR: they sit inside the hunks of #16018 and #16052, and reading those patches line by line shows both use the symbol as context only, so neither implements it. They are answered in #19546, which keeps one topic per PR.This branch answers 24 of the 1783 NID exports of
libSceNpCppWebApi. On themainit now carries (e083b03cff)tools/progress.py --module libSceNpCppWebApireports 1371 of 1799, leaving 102NotImplementedstubs; with this PR and the four sibling ones merged it reaches 1450 of 1799 with 23 stubs left. The patched prx exports 1783 NIDs before and after, so no symbol is added or dropped.Tested
Windows 10 22H2 (19045), MinGW GCC 15.2.0, MinGW-Ninja build.
guest_np_cpp_web_api_session_manager_values(new) drives every accessor over a buffer filled with0xa5; the flags are checked by flipping only their own byte to 0, 1 and0xa5and by filling every earlier byte with0xff; the account id is a 64-bit value with0xffneighbours on both sides, and the join state is negative so a signed field read as unsigned shows up; the four member copies are checked to return the three words of theIntrusivePtrand to increment the reference count at 0x00 or 0x30 as the member kind requires.ctest -R np_cpp_web_apireports 21 of 21 on this branch after merginge083b03cff: the 20 suitesmainhas plus this PR's own.build/core/libs/libs/unpatched/libSceNpCppWebApi.prxwas parsed before and after: 1783 names both times, so no symbol was added or dropped, and the 24 targets are present.Checklist
main; no other open PR implements the same functions — checked every open PR's file list (1502 at the time of writing); the only overlap in this library isGetUsersAccountIdPlayerSessionsInvitationsResponseBody::getInvitations, which is left untouched (feat(libSceNpCppWebApi): allocate String, Vector and IntrusivePtr objects from the LibContext #16018, feat(libSceNpCppWebApi): implement the shared transaction bookkeeping #16052)NotImplemented_nid_no_patch); no silent stubs added.mdfiles or images added to the repository