Stub missing SystemService / NpManager / NpWebApi2 imports (Palworld, PPSA23126) #2035

Manually merged
github merged 3 commits from gh-pr/2035/head into gh-pr/2035/base 2026-11-26 10:12:32 +00:00
Owner

@⁠Ekt0re on GitHub · 2026-10-31 20:57 UTC · original
Ekt0re:Implement-m5CYKX20wfg-uaieF+glFPs-VgYczPGB5ss-KJdPcOGmK58-hOnIlcGrO6g → main · +57 −1 · 4 files · 3 commits · merged 2026-10-31 22:50 UTC

Stub missing SystemService / NpManager / NpWebApi2 imports (Palworld, PPSA23126)

Summary

Palworld (PPSA23126) reaches in-game but logs five unresolved imports as Stubbed. This PR implements them so the game no longer hits the generic stub path:

NID Library Function
m5CYKX20wfg SystemService sceSystemServiceInitializePlayerDialogParam
uaieF+glFPs SystemService sceSystemServiceLaunchPlayerDialog
VgYczPGB5ss NpManager sceNpGetUserIdByAccountId
KJdPcOGmK58 NpWebApi2 sceNpWebApi2PushEventDeleteFilter
hOnIlcGrO6g NpWebApi2 sceNpWebApi2PushEventUnregisterCallback

Related issue: #1960

  • Emulator build: KytyPS5-2026-10-27-ffc8137 (0.3.0)
  • Game status before this PR: In game, with the five stubs above in the log.

Changes

src/libs/libSystemService.cpp

  • Added SystemServiceInitializePlayerDialogParam() and SystemServiceLaunchPlayerDialog().
  • Both log via PRINT_NAME() and return OK. No system player dialog UI is available in the emulator, so there is nothing to show.
  • Registered with LIB_FUNC in InitSystemService_1.

src/libs/network.cpp / network.h

  • Added NpGetUserIdByAccountId(uint64_t account_id, int* user_id) and declared it in network.h.
  • Behaviour:
    1. account_id == 0 or user_id == nullptr → np_error_invalid_argument
    2. PSN emulation disabled → np_error_signed_out
    3. account_id differs from the primary user's fixed account ID (the same one returned by NpGetAccountIdA), or the primary user is a guest → np_error_invalid_id
    4. Otherwise → writes the primary user's ID to *user_id and returns OK
  • *user_id is left untouched on every error path.

src/libs/libNet.cpp

  • Registered NpManager::NpGetUserIdByAccountId (VgYczPGB5ss) in InitNet_1_NpManager.
  • Added NpWebApi2PushEventDeleteFilter (KJdPcOGmK58): returns NP_WEBAPI2_ERROR_INVALID_LIB_CONTEXT_ID for lib_ctx_id <= 0, NP_WEBAPI2_ERROR_LIB_CONTEXT_NOT_FOUND for an unknown context, and OK otherwise.
  • Added NpWebApi2PushEventUnregisterCallback (hOnIlcGrO6g): logs and returns OK.
  • Added the error constants NP_WEBAPI2_ERROR_USER_CONTEXT_NOT_FOUND, NP_WEBAPI2_ERROR_PUSH_EVENT_FILTER_NOT_FOUND and NP_WEBAPI2_ERROR_PUSH_EVENT_CALLBACK_NOT_FOUND.
  • Registered both new functions in InitNet_1_NpWebApi2.

Design notes

  • Push events are never delivered. In the reference implementation (shadPS4) processPushEvents() is an empty body, so registered push-event callbacks are never invoked. Filters and callbacks are pure bookkeeping, so an OK-returning implementation is observably equivalent for a game that registers and later unregisters correctly.
  • Known differences from the reference implementation:
    • Error codes for invalid filter/callback IDs are not reproduced (PUSH_EVENT_FILTER_NOT_FOUND, PUSH_EVENT_CALLBACK_NOT_FOUND, USER_CONTEXT_NOT_FOUND).
    • The reference waits (100 ms polling) while a callback is running (is_busy) before deleting it. Not needed here, since callbacks are never run.
  • Player dialog: the reference has these two functions only as name-table entries with no implementation, so the parameter structure layout is unknown. The stubs therefore don't touch any pointer.

Testing

  • Build succeeds.
  • No regressions in other titles using NpManager / NpWebApi2.

References

**@⁠Ekt0re** on GitHub · 2026-10-31 20:57 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2035) `Ekt0re:Implement-m5CYKX20wfg-uaieF+glFPs-VgYczPGB5ss-KJdPcOGmK58-hOnIlcGrO6g` → `main` · +57 −1 · 4 files · 3 commits · merged 2026-10-31 22:50 UTC # Stub missing SystemService / NpManager / NpWebApi2 imports (Palworld, PPSA23126) ## Summary Palworld (PPSA23126) reaches in-game but logs five unresolved imports as `Stubbed`. This PR implements them so the game no longer hits the generic stub path: | NID | Library | Function | |---|---|---| | `m5CYKX20wfg` | SystemService | `sceSystemServiceInitializePlayerDialogParam` | | `uaieF+glFPs` | SystemService | `sceSystemServiceLaunchPlayerDialog` | | `VgYczPGB5ss` | NpManager | `sceNpGetUserIdByAccountId` | | `KJdPcOGmK58` | NpWebApi2 | `sceNpWebApi2PushEventDeleteFilter` | | `hOnIlcGrO6g` | NpWebApi2 | `sceNpWebApi2PushEventUnregisterCallback` | Related issue: https://git.gtahub.st/github/KytyPS5--KytyPS5/issues/1960 - Emulator build: `KytyPS5-2026-10-27-ffc8137 (0.3.0)` - Game status before this PR: *In game*, with the five stubs above in the log. ## Changes ### `src/libs/libSystemService.cpp` - Added `SystemServiceInitializePlayerDialogParam()` and `SystemServiceLaunchPlayerDialog()`. - Both log via `PRINT_NAME()` and return `OK`. No system player dialog UI is available in the emulator, so there is nothing to show. - Registered with `LIB_FUNC` in `InitSystemService_1`. ### `src/libs/network.cpp` / `network.h` - Added `NpGetUserIdByAccountId(uint64_t account_id, int* user_id)` and declared it in `network.h`. - Behaviour: 1. `account_id == 0` or `user_id == nullptr` → `np_error_invalid_argument` 2. PSN emulation disabled → `np_error_signed_out` 3. `account_id` differs from the primary user's fixed account ID (the same one returned by `NpGetAccountIdA`), or the primary user is a guest → `np_error_invalid_id` 4. Otherwise → writes the primary user's ID to `*user_id` and returns `OK` - `*user_id` is left untouched on every error path. ### `src/libs/libNet.cpp` - Registered `NpManager::NpGetUserIdByAccountId` (`VgYczPGB5ss`) in `InitNet_1_NpManager`. - Added `NpWebApi2PushEventDeleteFilter` (`KJdPcOGmK58`): returns `NP_WEBAPI2_ERROR_INVALID_LIB_CONTEXT_ID` for `lib_ctx_id <= 0`, `NP_WEBAPI2_ERROR_LIB_CONTEXT_NOT_FOUND` for an unknown context, and `OK` otherwise. - Added `NpWebApi2PushEventUnregisterCallback` (`hOnIlcGrO6g`): logs and returns `OK`. - Added the error constants `NP_WEBAPI2_ERROR_USER_CONTEXT_NOT_FOUND`, `NP_WEBAPI2_ERROR_PUSH_EVENT_FILTER_NOT_FOUND` and `NP_WEBAPI2_ERROR_PUSH_EVENT_CALLBACK_NOT_FOUND`. - Registered both new functions in `InitNet_1_NpWebApi2`. ## Design notes - **Push events are never delivered.** In the reference implementation (shadPS4) `processPushEvents()` is an empty body, so registered push-event callbacks are never invoked. Filters and callbacks are pure bookkeeping, so an `OK`-returning implementation is observably equivalent for a game that registers and later unregisters correctly. - **Known differences from the reference implementation:** - Error codes for invalid filter/callback IDs are not reproduced (`PUSH_EVENT_FILTER_NOT_FOUND`, `PUSH_EVENT_CALLBACK_NOT_FOUND`, `USER_CONTEXT_NOT_FOUND`). - The reference waits (100 ms polling) while a callback is running (`is_busy`) before deleting it. Not needed here, since callbacks are never run. - **Player dialog:** the reference has these two functions only as name-table entries with no implementation, so the parameter structure layout is unknown. The stubs therefore don't touch any pointer. ## Testing - Build succeeds. - No regressions in other titles using NpManager / NpWebApi2. ## References - shadPS4 `np_manager.cpp` (`sceNpGetUserIdByAccountId`): https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/np/np_manager.cpp - shadPS4 `np_web_api2.cpp`: https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/np/np_web_api2/np_web_api2.cpp - shadPS4 `np_web_api2_context.cpp`: https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/np/np_web_api2/np_web_api2_context.cpp - shadPS4 `np_web_api2_push_event.cpp`: https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/np/np_web_api2/np_web_api2_push_event.cpp - shadPS4 `np_error.h`: https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/np/np_error.h
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:12:30 +00:00
github manually merged commit 7d8b3e5c58 into gh-pr/2035/base 2026-11-26 10:12:32 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-31 21:05 UTC · original · edited 2026-10-31 21:28 UTC

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between bbf96a5e9f and 8ec432e109.

Files selected for processing: 4
  • src/libs/libNet.cpp
  • src/libs/libSystemService.cpp
  • src/libs/network.cpp
  • src/libs/network.h

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The changes add an account-to-user lookup API, two WebAPI 2 push-event operations, and two player-dialog service stubs. The account lookup accepts one fixed account ID when PSN emulation is enabled and the configured primary user is not a guest. The push-event functions delete a filter after checking its library context, or return success for callback unregistration. Both player-dialog stubs log their names and return OK.

Suggested reviewers: nmzik

Change: Feature

Merge Risk: Minimal · up to 8ec43

Account lookup is consistent with existing local accounts. Push-event cleanup remains stubbed; no material merge-blocking risk is established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description check Passed The description clearly explains the five missing imports, their implementations, registrations, behavior, design notes, and testing.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title names the three areas the PR touches (SystemService, NpManager, NpWebApi2) and the target title (Palworld, PPSA23126). It is a single, specific sentence with no vague terms. However, the tit…
Full details: Title check

Explanation

The title names the three areas the PR touches (SystemService, NpManager, NpWebApi2) and the target title (Palworld, PPSA23126). It is a single, specific sentence with no vague terms. However, the title says "Stub", which fits only the two SystemService player-dialog functions and the NpWebApi2 push-event functions. It omits the main substantive change: the new sceNpGetUserIdByAccountId implementation with account and primary-user validation. The title is therefore partially related: it refers to real parts of the change, but it does not name the most important change, and it does not fully describe the NpManager logic.

Full details: Docstring Coverage

Explanation

Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 14 functions across 4 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
**@⁠coderabbitai[bot]** on GitHub · 2026-10-31 21:05 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2035#issuecomment-6549119169) · edited 2026-10-31 21:28 UTC <!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/2035?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. <details> <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="16" height="16" align="absmiddle" alt=""></picture> Recent review info</strong></summary> <dl> <dd> <!-- review_info_content --> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary> <dl> <dd> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/bbf96a5e9f69cad84b99791d6418c81d01913e75/.coderabbit.yaml>) - **Commit**: [bbf96a5](<https://github.com/KytyPS5/KytyPS5/commit/bbf96a5e9f69cad84b99791d6418c81d01913e75>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `d312921c-af59-45d6-88ca-e9de4ff7ca69` </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary> <dl> <dd> Reviewing files that changed from the base of the PR and between bbf96a5e9f69cad84b99791d6418c81d01913e75 and 8ec432e10910a0475779e2913bfb49e6c8cac649. </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 4</strong></summary> <dl> <dd> * `src/libs/libNet.cpp` * `src/libs/libSystemService.cpp` * `src/libs/network.cpp` * `src/libs/network.h` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. </dd> </dl> </details> <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> The changes add an account-to-user lookup API, two WebAPI 2 push-event operations, and two player-dialog service stubs. The account lookup accepts one fixed account ID when PSN emulation is enabled and the configured primary user is not a guest. The push-event functions delete a filter after checking its library context, or return success for callback unregistration. Both player-dialog stubs log their names and return OK. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"8ec432e10910a0475779e2913bfb49e6c8cac649" --> <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} --> **Change:** Feature <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>8ec43</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **⚪ Minimal** · up to `8ec43` --> <!-- final_review_risk_coverage:{"sourceCommitId":"8ec432e10910a0475779e2913bfb49e6c8cac649","coveredCommitId":"8ec432e10910a0475779e2913bfb49e6c8cac649","kind":"reviewed"} --> Account lookup is consistent with existing local accounts. Push-event cleanup remains stubbed; no material merge-blocking risk is established. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4 · <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> 1</strong></summary> <dl> <dd> <strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> Failed checks: 1 warning</strong> | Check name | Status | Explanation | Resolution | | :---------------- | :----------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ![Warning](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-warning.svg) | Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary><strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> Passed checks: 4 passed</strong></summary> <dl> <dd> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description clearly explains the five missing imports, their implementations, registrations, behavior, design notes, and testing. | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title names the three areas the PR touches (SystemService, NpManager, NpWebApi2) and the target title (Palworld, PPSA23126). It is a single, specific sentence with no vague terms. However, the tit… | <details> <summary><strong>Full details: Title check</strong></summary> <dl> <dd> **Explanation** The title names the three areas the PR touches (SystemService, NpManager, NpWebApi2) and the target title (Palworld, PPSA23126). It is a single, specific sentence with no vague terms. However, the title says "Stub", which fits only the two SystemService player-dialog functions and the NpWebApi2 push-event functions. It omits the main substantive change: the new sceNpGetUserIdByAccountId implementation with account and primary-user validation. The title is therefore partially related: it refers to real parts of the change, but it does not name the most important change, and it does not fully describe the NpManager logic. </dd> </dl> </details> </dd> </dl> </details> <details> <summary><strong>Full details: Docstring Coverage</strong></summary> <dl> <dd> **Explanation** Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 14 functions across 4 files. **Resolution** Write docstrings for the functions missing them to satisfy the coverage threshold. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=2035)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>Share</strong></summary> <dl> <dd> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </dd> </dl> </details> <!-- tips_end -->
This discussion has been locked. Commenting is limited to contributors.
No description provided.