Make admin setrank a full console team-rank tool - #3079
Merged
Conversation
Server staff asked to promote and demote team members without logging in. /admin setrank <player> <rank> [island owner] already existed and ran from the console, but it was rough enough to be unreliable for that: - Only the rank's translated display name matched, so the rank had to be typed as it appears in the caller's locale. Now the keyword (member, sub-owner, trusted, coop, or any addon rank without the ranks. prefix), the translated name, or the numeric value all work, and the error lists the valid choices. - Owner, mod and admin ranks were accepted. Setting owner rank in the member map without moving the owner field left the island inconsistent. These are now refused and the admin is pointed at setowner. - With no island named, the target's primary island was used even when they owned it, so the command could demote an owner into a member. Now the island the target is a member of (but does not own) is used, and if they are on several team islands the centres are listed so one can be chosen. - The island can now be named by x,y,z centre as well as by owner, which is needed when an owner has concurrent islands. - Tab completion was off by one (players offered for the rank slot, ranks for the owner slot) and now completes the correct argument. - The affected player is told their rank changed, and a no-op change is reported instead of silently succeeding. Locale keys added under commands.admin.setrank in every bundled locale: cannot-set-owner, already-rank, admin-changed-rank; unknown-rank gained [rank] and [ranks] placeholders. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0146MpZW6KGnu5E4qkcR5NXV
|
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
Admins want to promote and demote team members from the console without logging in. Rather than add a second command, this turns the existing console-capable
/[admin] setrank <player> <rank> [island owner]into something reliable enough for that job.Syntax is now
/[admin] setrank <player> <rank> [island owner | x,y,z]and is backwards compatible.Fixes and improvements
member,sub-owner,trusted,coop(or any addon rank reference without theranks.prefix), the translated name, or the numeric value all work, case-insensitively. The error lists the valid choices.ownerrank in the member map without moving the owner field left the island inconsistent. These are now refused with a message pointing atsetowner.x,y,z: the island can be named by its centre as well as by owner. Needed when an owner has concurrent islands.Locale changes
New keys under
commands.admin.setrankin every bundled locale:cannot-set-owner,already-rank,admin-changed-rank.unknown-rankgained[rank]and[ranks]placeholders, andparameters/descriptionwere updated.Test plan
AdminSetrankCommandTestrewritten: 34 tests covering rank parsing (keyword, translated, numeric, reference), rank range refusals, island resolution (none / owner / xyz / ambiguous), owner guard, no-op guard, promote and demote execution, events, tab completion.setrank Alice sub-ownerfrom the console with Alice on one team island;setrank Alice member Bobandsetrank Alice member 0,64,0with Alice on two islands.🤖 Generated with Claude Code
https://claude.ai/code/session_0146MpZW6KGnu5E4qkcR5NXV