Repository navigation
feat(libSceUserService): implement sceUserServiceGetUserStatus and account mapping - #4433
ErenYeager1836 wants to merge 3 commits into
Conversation
| int APS5_VABI sceUserServiceGetUserColor(int user_id, int* color); | ||
| int APS5_VABI sceUserServiceGetNpAccountId(int user_id, std::uint64_t* account_id); | ||
| int APS5_VABI sceUserServiceGetAgeLevel(int user_id, std::uint32_t* age_level); | ||
| int APS5_VABI sceUserServiceGetUserStatus(int user_id, std::int32_t* status); |
There was a problem hiding this comment.
These declarations are not called from main(), so guest_user_service does not exercise the three new implementations, despite the PR description saying it covers their success and error paths. Could you add assertions for the initial/unknown user and account/name cases, plus null output pointers, before relying on this test pass?
There was a problem hiding this comment.
Thanks for the thorough review @MarcZX100!
Pushed commit 7e779f0e1 adding the test assertions right after GetAgeLevel:
- Reuses
0x5a5a5a5asentinels to verify error paths leave output buffers untouched. - Tested
sceUserServiceGetUserStatus: checks initial user success (USER_STATUS_LOGGED_IN), absent users returningNOT_LOGGED_IN(even with null pointers, matchingGetAgeLevel), and null pointer on initial user returningINVALID_ARGUMENT. - Tested
sceUserServiceGetUserIdByNpAccountId: checks initial account (0), null pointer paths, and unknown accounts including0x100000000ullto guard against 32-bit truncation. - Tested
sceUserServiceGetUserIdByUserName: checks exact match ("Player"), null pointers, and mismatch strings ("","Playe","Player2").
7e779f0 to
37f2311
Compare
…count mapping
- Export sceUserServiceGetUserStatus, reporting logged-in status (1) for USER_SERVICE_INITIAL_USER_ID and USER_SERVICE_ERROR_NOT_LOGGED_IN for absent users.
- Export sceUserServiceGetUserIdByNpAccountId, mapping the default account id (0) to USER_SERVICE_INITIAL_USER_ID and returning USER_SERVICE_ERROR_UNKNOWN_USER for other IDs.
- Export sceUserServiceGetUserIdByUserName, resolving USER_SERVICE_INITIAL_USER_NAME ("Player") to USER_SERVICE_INITIAL_USER_ID and returning USER_SERVICE_ERROR_UNKNOWN_USER for unknown names.
- Add test coverage in GuestUserService.cpp validating success returns and boundary error handling.
- Record single-user state and identifier mappings in TechnicalDebt.md.
…xports in guest test
37f2311 to
fa40c39
Compare
|
Closing: no title is shown calling |
What
Implement
sceUserServiceGetUserStatus,sceUserServiceGetUserIdByNpAccountId, andsceUserServiceGetUserIdByUserNameinlibSceUserService:sceUserServiceGetUserStatusreportsUSER_SERVICE_USER_STATUS_LOGGED_IN(1) forUSER_SERVICE_INITIAL_USER_IDandUSER_SERVICE_ERROR_NOT_LOGGED_INfor absent users, matching the sibling getters' argument precedence.sceUserServiceGetUserIdByNpAccountIdmaps the initial account id (0) toUSER_SERVICE_INITIAL_USER_ID, returningUSER_SERVICE_ERROR_UNKNOWN_USERfor non-zero account IDs.sceUserServiceGetUserIdByUserNameresolves the default profile username ("Player") toUSER_SERVICE_INITIAL_USER_ID, rejecting unknown usernames withUSER_SERVICE_ERROR_UNKNOWN_USER.GuestUserService.cppvalidating all success and error return paths with sentinels and 64-bit boundaries.libcintoguest_user_service_testsinCMakeLists.txtforstd::strcmpusername assertions.TechnicalDebt.md.Tested
Windows 11, MinGW-w64 GCC 15.2.0, ctest
guest_user_servicepassed in 0.08 s (exercising status, 64-bit account bounds, and exact string matches).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)