Skip to content

Make admin setrank a full console team-rank tool - #3079

Merged
tastybento merged 1 commit into
developfrom
feature/admin-setrank-console
Sep 7, 2026
Merged

Make admin setrank a full console team-rank tool#3079
tastybento merged 1 commit into
developfrom
feature/admin-setrank-console

Conversation

@tastybento

Copy link
Copy Markdown
Member

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

  • Rank argument: previously only the rank's translated display name matched. Now member, sub-owner, trusted, coop (or any addon rank reference without the ranks. prefix), the translated name, or the numeric value all work, case-insensitively. The error lists the valid choices.
  • Owner/mod/admin ranks refused: setting owner rank in the member map without moving the owner field left the island inconsistent. These are now refused with a message pointing at setowner.
  • Island selection without an argument: 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; if they are on several team islands the centres are listed so one can be chosen.
  • Island by x,y,z: the island can be named by its centre as well as by owner. 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 right argument.
  • The affected player is told their rank changed, and a no-op change is reported instead of silently succeeding.

Locale changes

New keys under commands.admin.setrank in every bundled locale: cannot-set-owner, already-rank, admin-changed-rank. unknown-rank gained [rank] and [ranks] placeholders, and parameters/description were updated.

Test plan

  • AdminSetrankCommandTest rewritten: 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.
  • Full suite: 3507 tests, 0 failures.
  • Manual check on a server: setrank Alice sub-owner from the console with Alice on one team island; setrank Alice member Bob and setrank Alice member 0,64,0 with Alice on two islands.

🤖 Generated with Claude Code

https://claude.ai/code/session_0146MpZW6KGnu5E4qkcR5NXV

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
@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

@tastybento
tastybento merged commit 51042a3 into develop Sep 7, 2026
3 checks passed
@tastybento
tastybento deleted the feature/admin-setrank-console branch September 7, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant