Repository navigation
Conversation
A second user with a caller-given display name that appears for the length of a share and coexists with controller hotplug on the same slot. It reports no PSN account.
|
@parl0v, #30 is merged with current main and green, ready for your re-review. I have not merged it. What changed in the merge: main merged in with a merge commit (no rebase, no force push; head a18a3b7). There were no conflicts. I also merged the fix from PR #40 into this branch, because every full Build: dispatch run https://github.com/anyplaynet/AnyPS5/actions/runs/40604915342 on this head: Windows, Linux and the relinker jobs (macOS arm64 and x86_64, asan) are all green. Note for the order of merging: #29 has a TODO at the |
What
Adds a guest user to libSceUserService, the second user a game needs to see before it lets a second player join locally. Share play's
togethermode (#29) will log it in when the mode starts and out when it ends.UserServiceSetGuestUser_nid_postfix(userIndex, name)andUserServiceClearGuestUser_nid_postfix(userIndex)inUserService.hpp. This is the seam: nothing in this PR calls it, the share code does later.0x10000000 + index), soscePadOpenfor that user already returns the handle of the pad on the same port. Pad 2 of a share is port 1, therefore user index 1. No libScePad change is needed.sceUserServiceGetUserNamereturns the display name the caller gave, cut to 16 bytes at a UTF-8 character boundary, control characters and invalid UTF-8 dropped, trimmed. With no name, or one that is empty after that, it returns the slot's default name (Player2).sceUserServiceGetNpAccountIdreturns 0 for a guest. The host's PSN account must not be handed to another person.share open,share mode,share pad) carry no guest handle, so the name is a parameter the share code fills when the bridge learns it. Until a name field exists, the default applies. Aguest_namestring onshare modewould be the smallest addition; that is a network spec change, not part of this PR.Based on
main, not on #29: no API of the share branch is used. Once #29 lands, itstogetherhandling calls these two functions, and the "Share play guest pad" debt entry in libScePad (Closes when: the user service has a second user) can be closed.Tested
Not tested on a title. New host test
guest_user_service_guest_user(GuestUserServiceGuestUser.cpp): claim before and aftersceUserServiceInitialize, event order and collapsing of a claim that ends before it is read, login and registered lists, user number, age level, account id 0, name sanitising (truncation at a character boundary, control characters, invalid UTF-8, empty, whitespace), claim and hotplug on the same slot in both orders, out-of-range slots ignored. The Windows and Linux build and test jobs of this PR run it with the existing user service tests.tools/check_conventions.pypasses locally; the C++ tree was not built locally, only syntax-checked.Needs a real game: whether a title's local-multiplayer join flow accepts a user with no PSN account, and what it does on the logout event while it is in a match. Recorded in
docs/dev/debt/libSceUserService.md.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)togethermode of feat(bridge): share play frame ring, guest pad and host override #29Need help on this PR? Tag
@codesmith-botwith what you need.