feat(libSceNpCppWebApi): bring up the SessionManager friends player sessions family #13255

Merged
edubox merged 3 commits from upstream-pr/13255 into main 2026-11-05 08:51:35 +00:00
edubox commented 2026-10-30 08:14:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by edubox on 2026-10-30T08:14:14Z.


What

Implement the 45 exports imported for SessionManager::V1::PlayerSessionsApi::getFriendsPlayerSessions that were still missing:

  • ParameterToGetFriendsPlayerSessions lifecycle (C1, D1, initialize, terminate).
  • getFriendsPlayerSessions, the Transaction and TransactionBase entry points.
  • Friend, FriendJoinedPlayerSession and GetFriendsPlayerSessionsResponseBody accessors.
  • The IntrusivePtr, Vector and ConstIterator helpers used by this family.

The model layouts come from the module bundled with the titles (build J03341606): Friend stores account id at +0x10, accountIdIsSet at +0x18, IntrusivePtr<Vector<FriendJoinedPlayerSession>> at +0x30 and playerSessionsIsSet at +0x48; FriendJoinedPlayerSession stores String sessionId at +0x10 and sessionIdIsSet at +0x30; the response body stores IntrusivePtr<Vector<Friend>> at +0x30. The vector views use the real inline layout (begin +0x18, end +0x28, refcount +0x30, 0x18-byte elements) and the iterator is {int32 referenceCount; void* element}.

The transaction is 0x10 bytes: its constructor zeroes both words. TransactionBase::start returns 0x80553503 for a null context, 0x80553502 for an uninitialized context and then SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN; finish returns 0x80553508. getResponse and getFriendsPlayerSessions return 0x80553508 while the two transaction words are zero (unstarted), and SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN once the transaction is started; no response object is produced.

Tested

  • ctest --test-dir build -R guest_np_cpp_web_api: 8/8 passed, including the new guest_np_cpp_web_api_friends.
  • The new test covers the parameter lifecycle, transaction initialization and the state-sensitive start/getResponse/API errors (with a prefilled transaction and an unchanged output sentinel), model getters, IntrusivePtr copy/destroy, the inline vector layout, iterator traversal and getFriends/getPlayerSessions copy/add-ref.
  • python3 tools/check_conventions.py --base origin/main: passed.
  • python3 tools/pr_overlap.py --branch feat/npcpp-friends-sessions --jobs 32: no overlap.
  • Not tested in a game: the family is offline-only here and no response object is produced.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #10925, #11221
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5081446880 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13255). Originally posted by [edubox](https://github.com/edubox) on 2026-10-30T08:14:14Z. --- ### What Implement the 45 exports imported for `SessionManager::V1::PlayerSessionsApi::getFriendsPlayerSessions` that were still missing: - `ParameterToGetFriendsPlayerSessions` lifecycle (`C1`, `D1`, `initialize`, `terminate`). - `getFriendsPlayerSessions`, the `Transaction` and `TransactionBase` entry points. - `Friend`, `FriendJoinedPlayerSession` and `GetFriendsPlayerSessionsResponseBody` accessors. - The `IntrusivePtr`, `Vector` and `ConstIterator` helpers used by this family. The model layouts come from the module bundled with the titles (build J03341606): `Friend` stores account id at `+0x10`, `accountIdIsSet` at `+0x18`, `IntrusivePtr<Vector<FriendJoinedPlayerSession>>` at `+0x30` and `playerSessionsIsSet` at `+0x48`; `FriendJoinedPlayerSession` stores `String sessionId` at `+0x10` and `sessionIdIsSet` at `+0x30`; the response body stores `IntrusivePtr<Vector<Friend>>` at `+0x30`. The vector views use the real inline layout (begin `+0x18`, end `+0x28`, refcount `+0x30`, 0x18-byte elements) and the iterator is `{int32 referenceCount; void* element}`. The transaction is 0x10 bytes: its constructor zeroes both words. `TransactionBase::start` returns `0x80553503` for a null context, `0x80553502` for an uninitialized context and then `SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN`; `finish` returns `0x80553508`. `getResponse` and `getFriendsPlayerSessions` return `0x80553508` while the two transaction words are zero (unstarted), and `SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN` once the transaction is started; no response object is produced. ### Tested - `ctest --test-dir build -R guest_np_cpp_web_api`: 8/8 passed, including the new `guest_np_cpp_web_api_friends`. - The new test covers the parameter lifecycle, transaction initialization and the state-sensitive `start`/`getResponse`/API errors (with a prefilled transaction and an unchanged output sentinel), model getters, `IntrusivePtr` copy/destroy, the inline vector layout, iterator traversal and `getFriends`/`getPlayerSessions` copy/add-ref. - `python3 tools/check_conventions.py --base origin/main`: passed. - `python3 tools/pr_overlap.py --branch feat/npcpp-friends-sessions --jobs 32`: no overlap. - Not tested in a game: the family is offline-only here and no response object is produced. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #10925, #11221 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!13255
No description provided.