libNet: answer sceNpGetAccountLanguage2 as a signed-out user #1186
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1186
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1186/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@overlordxrz-source on GitHub · 2026-10-08 02:31 UTC · original
overlordxrz-source:libs/np-account-language2→main· +22 −0 · 3 files · 2 commits · merged 2026-10-08 12:48 UTCsceNpGetAccountLanguage2(3Tcz5bNCfZQ) is not registered, so games that call it get the unresolved-import stub. The stub returns 0. That tells the game the request worked and that its language-code buffer now holds the account's language, but nothing was written there.Every other NpManager account query in
network.cppanswers as a signed-out user:sceNpGetAccountAge,sceNpGetAccountCountryA,sceNpGetAccountIdA,sceNpGetNpId. This registerssceNpGetAccountLanguage2next to them and does the same:SCE_NP_ERROR_INVALID_ARGUMENT(0x80550003) for a request id <= 0 or a null output pointer, the same checkNpGetAccountAgemakesSCE_NP_ERROR_REQUEST_NOT_FOUND(0x80550014) when a positive request id does not refer to a live request, including a deleted requestSCE_NP_ERROR_SIGNED_OUT(0x80550006) for an existing requestThe arguments are
(req_id, user_id, language_code*), the same shape assceNpGetAccountAgeandsceNpGetAccountLanguageA. The call sequence in the Saros log fits that too.Evidence
SIEAnalyticsWorkerThread, the game creates a request, callssceNpGetAccountAge(which returns SIGNED_OUT) and deletes the request. Then it creates a new request and hitsUnresolved import stub called [0]: ... symbol=3Tcz5bNCfZQ[NpManager_v1][NpManager_v1.1][Func], then deletes that request. So right now it's told the user is signed out for the age query and signed in for the language query.This is a consistency fix. I'm not claiming it changes how far any of these games get.
Testing
There's no NpManager test target, and adding a full-emulator one for this felt like too much. What I ran (my machine is aarch64 Linux, no Vulkan):
network.cppandlibNet.cpp(zig c++ 0.16, static musl, with unreferenced emulator symbols stubbed). It resolves3Tcz5bNCfZQthroughInitNet_1_NpManagerand checks SIGNED_OUT for a valid request, that the output buffer is untouched, INVALID_ARGUMENT for request id 0, a negative request id and a null pointer, and that the codes matchNpGetAccountAge. All of them pass.network.cppandlibNet.cppforx86_64-linux-gnuat-Wall -Wextra. The new lines add no warnings.src/.clang-format(clang-format 23.1.3)Not built on Windows or macOS.
Follow-up verification:
network.cppandlibNet.cppat-Wall -Wextrapassed; warnings were in existing code.git diff --checkand formatting checks for the changed function passed.AI assistance
An AI assistant helped me find the missing export in the issue logs, write the change and the harness, and run the builds above. I reviewed the code and the results.
@coderabbitai[bot] on GitHub · 2026-10-08 02:34 UTC · original · edited 2026-10-08 12:46 UTC
📝 Walkthrough
Walkthrough
The change adds
NpGetAccountLanguage2to theNpManagerAPI and symbol table. The function returnsnp_error_invalid_argumentwhen the request ID is nonpositive or the language-code pointer is null. If no active request matches the ID, it returnsnp_error_request_not_found. Otherwise, it returnsnp_error_signed_outwithout writing a language code.Suggested reviewers:
nmzikPriority: ⬇️ Low
Change: Bug fix
Merge Risk: 🟡 Moderate · up to
9407bCallers can receive an inconsistent error for the new account-language query. Correct the response before merging.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
sceNpGetAccountLanguage2to return the signed-out response.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
Comment
@coderabbitai helpto get the list of available commands.@ -4109,0 +4120,4 @@std::lock_guard lock(g_np_request_mutex);if (np_get_request_locked(req_id) == nullptr) {return np_error_request_not_found;@coderabbitai[bot] on GitHub · 2026-10-08 12:44 UTC · original
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Return
np_error_signed_outfor positive IDs without a request.NpGetAccountAgereturnsnp_error_signed_outfor any positivereq_idwhen its output pointer is valid. If the caller passes that same ID toNpGetAccountLanguage2without creating a request, this lookup returnsnp_error_request_not_foundinstead. Remove the request lookup so the two account queries give the intended signed-out response and leave the language output untouched.@coderabbitai[bot] on GitHub · 2026-10-08 12:44 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
2f20b0d9-f940-45f7-84d7-183e68e98b89📥 Commits
Reviewing files that changed from the base of the PR and between
40cee61178and9407ba9876.📒 Files selected for processing (1)
src/libs/network.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.