feat(libSceNpManager): implement sceNpGetUserIdByAccountId #1536

Closed
AcelezXYZ wants to merge 1 commit from upstream-pr/1536 into main
AcelezXYZ commented 2026-10-08 11:36:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AcelezXYZ on 2026-10-08T11:36:01Z.


What

Implements sceNpGetUserIdByAccountId(accountId, userId*) in libSceNpManager (PPSA14632 imports it).

  • Account id 0 or a null userId returns SCE_NP_ERROR_INVALID_ARGUMENT (0x80550003).
  • Every other call returns SCE_NP_ERROR_SIGNED_OUT (0x80550006) and leaves *userId untouched, as PSN is not emulated and no account is ever signed in (same model as sceNpGetAccountIdA and sceNpGetNpId).

Signature and argument errors follow the shadPS4 reimplementation of the PS4 library (pinned commit linked in TechnicalDebt; with its network service disabled it returns SIGNED_OUT the same way), not confirmed on a PS5 title.

Tested

  • Linux x86-64, GCC 13.3, Release build, full ctest: 441/442 pass. The only failure is guest_sce_net (no IPv6 in my sandbox, also fails on unmodified main); this PR does not touch libSceNet.
  • GuestNpManager extended: signed-out result with the user id untouched, account id 0 rejected, null user id rejected. A deliberately broken build (account id 0 accepted) makes the test fail.
  • tools/check_conventions.py --base origin/main passes.
  • Not tested with a title or homebrew.

Checklist

  • Based on current main (084aeeb6); no other open PR implements the same functions (all PR heads up to #1518 checked)
  • 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 in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes (Claude Code); the author is responsible for every line
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4786146017 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1536). Originally posted by [AcelezXYZ](https://github.com/AcelezXYZ) on 2026-10-08T11:36:01Z. --- ### What Implements `sceNpGetUserIdByAccountId(accountId, userId*)` in libSceNpManager (PPSA14632 imports it). - Account id 0 or a null `userId` returns `SCE_NP_ERROR_INVALID_ARGUMENT` (`0x80550003`). - Every other call returns `SCE_NP_ERROR_SIGNED_OUT` (`0x80550006`) and leaves `*userId` untouched, as PSN is not emulated and no account is ever signed in (same model as `sceNpGetAccountIdA` and `sceNpGetNpId`). Signature and argument errors follow the shadPS4 reimplementation of the PS4 library (pinned commit linked in TechnicalDebt; with its network service disabled it returns `SIGNED_OUT` the same way), not confirmed on a PS5 title. ### Tested - Linux x86-64, GCC 13.3, Release build, full `ctest`: 441/442 pass. The only failure is `guest_sce_net` (no IPv6 in my sandbox, also fails on unmodified `main`); this PR does not touch libSceNet. - `GuestNpManager` extended: signed-out result with the user id untouched, account id 0 rejected, null user id rejected. A deliberately broken build (account id 0 accepted) makes the test fail. - `tools/check_conventions.py --base origin/main` passes. - Not tested with a title or homebrew. ### Checklist - [x] Based on current `main` (084aeeb6); no other open PR implements the same functions (all PR heads up to #1518 checked) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes (Claude Code); the author is responsible for every line
github-actions[bot] commented 2026-10-08 11:56:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T11:56:14Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#1545 docs/dev/TechnicalDebt.md L95
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6059316520 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1536#issuecomment-6059316520). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T11:56:14Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #1545 | `docs/dev/TechnicalDebt.md` [L95](https://github.com/boykopovar/AnyPS5/blob/ae91d9780b3fe8dc71481841904fced01923c24b/docs/dev/TechnicalDebt.md#L95) | | |
oneandonlydean commented 2026-10-09 09:29:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:29:25Z.


Closing: PPSA14632 imports sceNpGetUserIdByAccountId, but no title is shown stopping at it on main. Reopen when it's a title's next stop there, with the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6078226380 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1536#issuecomment-6078226380). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T09:29:25Z. --- Closing: PPSA14632 imports `sceNpGetUserIdByAccountId`, but no title is shown stopping at it on main. Reopen when it's a title's next stop there, with the log line.

Pull request closed

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!1536
No description provided.