-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make APC UI work correctly with multiple users #32465
Make APC UI work correctly with multiple users #32465
Conversation
Well, at least now AI hostage situations will probably get fixed. |
you can use use IsAllowed in the ui as well to properly predict access |
You mean put a [Dependency] on AccessReaderSystem in the APC BoundUserInterface? Interesting, didn't realize that was allowed. Will try that out tomorrow. |
Turns out it isn't allowed, as it hits an UnregisteredDependencyException when constructing the BUI. It can be retrieved via the entity manager, though. |
System dependencies only work on other systems due to lifetime. |
you can use EntityManager.System to get the system |
you missed cl for this pr |
hi, nice PR! |
Didn't think it was worth it. Players won't notice a difference - you can't tell that someone else has the UI open, so you had to try to open it anyway. Now, it'll JustWork™ whenever they open the UI.
Took a quick look at the atmospheric alerts computer and that has the same fundamental problem in that it stores per-user state in a shared component. The code in this PR isn't really reusable - handling multiple users will differ depending on exactly what the UI wants to do. If you want to log a bug, I (or maybe somebody else) will get to it eventually. |
About the PR
Made APC user interface work correctly with multiple users.
Fixes #15563. Fixes #32312. Obsoletes #32356.
Why / Balance
Technical details
ApcComponent previously stored a 'HasAccess' on the component, updating it whenever a user opened the APC UI and sending that flag in the state to all users. This was per-user state being stored globally.
Now, no longer stores that state and instead sends a message to each user of the UI individually to inform them if they have access.
Media
APCMultiUser.mp4
Requirements
Breaking changes
Changelog