Add maskSkill setting to hide exact skill values from other players#92
Draft
tomjn wants to merge 1 commit into
Draft
Add maskSkill setting to hide exact skill values from other players#92tomjn wants to merge 1 commit into
tomjn wants to merge 1 commit into
Conversation
New opt-in global setting maskSkill (default 0, off). When enabled, skill values shown to other players are rounded down to the nearest 10 with a floor of 10, to prevent lower-skilled players from being singled out: - sendPlayerSkill: the battle script tag is broadcast identically to all clients, so it cannot be per-viewer; the masked value is sent to everyone. Team balancing is unaffected (it reads %battleSkills directly). - getBattleLobbyStatus (!status): masked per-viewer; a player still sees their own exact skill, and privileged users (level >= privacyTrustLevel) see exact values for everyone. Adds getMaskedSkill() helper, registers maskSkill in %globalParameters, the spads.conf template, and a helpSettings.dat entry.
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.
Summary
Adds a new opt-in global setting
maskSkill(default0, disabled) that hides exact skill values from other players, to mitigate lower-skilled players being singled out / bullied over their rating.When enabled, skill values shown to others are rounded down to the nearest 10, with a floor of 10. The real skill is still used internally for everything (team balancing is unaffected).
Behaviour
Skill is exposed through two channels, handled differently because of a hard constraint:
sendPlayerSkill) —SETSCRIPTTAGS game/players/<name>/skillis broadcast identically to every client in the battle, so it cannot be made per-viewer. WhenmaskSkillis on, the masked value (~N) is sent to everyone. This is consistent with the existing private-TrueSkill broadcast form, which already sends~N.!statuscommand (getBattleLobbyStatus) — this is per-viewer, so masking is conditional: a player still sees their own exact skill, and privileged users (access level>= privacyTrustLevel) see exact values for everyone. Everyone else sees~N.Masking is applied uniformly regardless of skill origin (rank / TrueSkill / Plugin / etc.).
Changes
getMaskedSkill()helper:max(10, int(skill/10)*10).maskSkillregistered in%globalParameters(SpadsConf.pm),etc/spads.conftemplate, and ahelpSettings.datentry.sendPlayerSkilland in both the player and spectator branches ofgetBattleLobbyStatus.Verification
No automated tests exist in this project and SPADS cannot run in a dev checkout, so this has not been verified at runtime — only:
perl -c(with a stub harness) passes forspads.plandSpadsConf.pm.helpSettings.datround-trips throughloadHelpSettingsFilewith the new entry parsed into all fields.getMaskedSkill()rounding/floor logic unit-checked in isolation (round down to nearest 10, floor 10, fractional and out-of-range inputs).Runtime behaviour (lobby broadcast +
!statusrendering on a live host) still needs human verification. Default-off, so existing deployments are unaffected until opted in.Draft pending that real-host verification.