Reenable Force Role and fix role assignment for the local player || Fix kicks when using judge overrule ability - #954
Open
wirtea wants to merge 11 commits into
Open
Reenable Force Role and fix role assignment for the local player || Fix kicks when using judge overrule ability#954wirtea wants to merge 11 commits into
wirtea wants to merge 11 commits into
Conversation
Removed lobby killing restriction message from PlayerControlPatches.
Removed buttons for sabotaging and repairing all systems.
Removed lobby killing restriction and related message.
Author
|
also just look at the changed files because the commits are so dead i accidently made a pr with the main branch instead of creating new one so i ended up removing other pull requests codes and add the new ones |
|
does this work non host |
Author
|
Obviously host only the force role is host only feature |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Force Role existed in the code but was disabled (commented) the toggle in HostOnlyTab was commented out and the function that actually runs it (ForceRolePPM) was never called. reenabled both
Also added Judge to the Force Role list since it was missing.
the role assignment itself (RoleManager.SetRole) only changes the role locally on host and never tells the server or other clients so it never actually assign as your real role and using Judge overrule ability while set this way you will get kicked from your own lobby (invalid RPC) tried a few lighter approaches first (swapping roles after normal dealing assigning before dealing) but none of them gave a consistent real assignment so i ended up replacing SelectRoles with a custom dealer that assigns your forced role first using RpcSetRole (the actual networked role assignment call) and then deals everyone else normally based on the lobby role settings
also added a fix/feature for Judge specifically: a forced judge doesnt complete tasks two hooks bypass that gate and grant the overrule use directly
tested: hosted a lobby > used Force Role to become Judge > started the match> used Overrule in a meeting with zero tasks done worked no kick correct role assigned every time