feat(userservice): implement foreground user, registered list, user colour and NP account id #553
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/553"
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?
Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-04T19:49:32Z.
What
Four
libSceUserServiceexports that titles call during start-up were missing. They nowreturn correct, general values for the single-user / offline model this library already
implements (
sceUserServiceGetInitialUser,sceUserServiceGetLoginUserIdList,sceUserServiceGetPlatformPrivacyWs1): validate the pointer and the user id, write thevalue, return
USER_SERVICE_OK.sceUserServiceGetForegroundUser(int* userId)— the only logged-in user is always in theforeground, so it returns
USER_SERVICE_INITIAL_USER_ID, likesceUserServiceGetInitialUser.sceUserServiceGetRegisteredUserIdList(UserServiceRegisteredUserIdList* list)— the initialuser occupies slot 0 and the remaining 15 slots are
USER_SERVICE_USER_ID_INVALID, the16-entry counterpart of the existing 4-entry
sceUserServiceGetLoginUserIdList.sceUserServiceGetUserColor(int userId, int* color)— a fresh profile defaults to blue(
0); other user ids giveUSER_SERVICE_ERROR_INVALID_ARGUMENT.sceUserServiceGetNpAccountId(int userId, uint64_t* accountId)— no PSN account is linked,so the account id is
0, consistent withsceUserServiceGetPlatformPrivacyWs1.Adds
UserServiceRegisteredUserIdList { int user_id[16]; }toSceTypes.hpp(next to theexisting
UserServiceLoginUserIdList) and aCMakeLists.txtfor the library so it can carrya guest test.
Signatures and the user-colour enum follow the public OpenOrbis SDK headers
(
include/orbis/UserService.h,include/orbis/_types/user.h).Tested
New test
core/libs/tests/GuestUserService.cpp(registered asguest_user_service): itchecks the valid returns, the null-pointer error, and the wrong-user-id error for each of the
four functions. It fails without the change (the four symbols are undefined) and passes with
it.
Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11;
ctest -R guest_user_servicepasses. Without the four implementations the test does not link (the symbols are undefined).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T21:19:37Z.
Thanks. The names match their NIDs, the foreground user and the 16-entry registered list follow the existing
sceUserServiceGetInitialUser/sceUserServiceGetLoginUserIdList, and colour 0 isSCE_USER_SERVICE_USER_COLOR_BLUEin the OpenOrbis header.One thing about
sceUserServiceGetNpAccountId: it reports success with account id 0, but main'ssceNpGetAccountIdA(libSceNpManager/Export.cpp) answers the same question withSCE_NP_ERROR_SIGNED_OUT. A title that reads the account id through UserService would then think the user has a PSN account with id 0. Do you know what the real function returns for a user with no linked account? If not, I'd either make it throw until that's known, or keep 0 and add a line under "Unknown function info" in docs/dev/TechnicalDebt.md saying the result is assumed. The same goes for the default colour, since it's also an assumption.The CI run on this PR still needs approval; I'll check it once it has run.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T22:33:06Z.
Progress report (
5fc8755→f467f51)📈 System libraries: 87.1% (+0.02%, +4 implemented functions)
✅ 4 implemented
sceUserServiceGetForegroundUsersceUserServiceGetNpAccountIdsceUserServiceGetRegisteredUserIdListsceUserServiceGetUserColorImported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-04T22:34:21Z.
Thanks for the review. I kept the values and documented both as assumptions under "Unknown function info" in docs/dev/TechnicalDebt.md (NP account id 0 vs
SCE_NP_ERROR_SIGNED_OUT, and the blue default colour). I don't have a confirmed source for either, so I'm happy to switchsceUserServiceGetNpAccountIdto throw instead if you'd prefer that until it's known.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T23:43:50Z.
Thanks, documenting both assumptions works for me; with the TechnicalDebt lines a title that depends on the account id will be easy to trace back here.
guest_user_servicepasses here and CI is green. Ready to merge from my side.This, #516 and #518 all insert at the same place in TechnicalDebt.md, so whichever lands later needs a one-line rebase.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T01:18:16Z.
#516 and #579 are on main now, so this needs a small rebase in docs/dev/TechnicalDebt.md. #579 replaced the "AMPR WaitOnAddress / WaitOnCounter ... WAIT_REG_MEM" line, so the resolution is main's lines (the sceRtcParseDateTime and the two AMPR lines) plus your two libSceUserService lines, without the old WAIT_REG_MEM one. Nothing else conflicts. Ready to merge from my side after that.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T21:20:51Z.
Are you still working on this? It still needs the one-line
docs/dev/TechnicalDebt.mdrebase from 10-05; the code was ready from my side then. If you'd rather not continue, please say so, and it can be closed.Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-06T21:52:15Z.
Rebased. docs/dev/TechnicalDebt.md now keeps main's lines (sceRtcParseDateTime and the two AMPR lines) plus the two libSceUserService lines, without the old WAIT_REG_MEM one. guest_user_service passes here.