Repository navigation
feat: staff admin commands for factions and guilds - #207
Draft
XxFran10xX wants to merge 3 commits into
Draft
XxFran10xX wants to merge 3 commits into
XxFran10xX wants to merge 3 commits into
Conversation
Adds /faction admin and /guild admin (simplefactions.admin) so staff can fix realms whose leader is away: info, who, rename, renamesettlement, movecapital + confirm, setcolour, setbanner, set culture/religion/ rulingsystem/rulertitle and kick for factions; info, rename, setcolour, setbanner and kick for guilds. They skip the leader check and any price and keep every other rule. Changes are logged as [StaffAdmin]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Staff can found the settlement again in a capital province that lost it, as /faction setcapital <name> does for leaders. - A capital move through the treasury needs the staff member to be playing a character; say so instead of throwing on confirm. - Only *_BANNER items count as banners (not banner patterns). - /faction admin set refuses a <placeholder> value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Standing outside any province says so, and only a capital move that goes through the treasury asks the staff member to play a character; founding a first capital or repairing one in place does not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Why
Staff could not change a faction or guild whose leader is away or stuck. Every rename, colour, banner, capital and kick command only checks "is this player the leader", so a request like "rename our capital from Research Tower of the Castle to Sunsora Castle" needed the leader online, or a hand edit of the faction file with the server stopped.
What
Two staff command groups, permission
simplefactions.admin. The staff versions skip the leader check and any price, and nothing else: names, colours and membership follow the same rules as the player commands. Anything that doesn't need a location or a held item also works from the console. Every change is written to the server log as[StaffAdmin] <who> ran /<command>: <result>./faction admininfo <faction>who <character>rename <faction> <name...>renamesettlement <faction> <settlement|capital> <name...>capitalpicks the faction capital. Settlement ids match without regard to case. Free, and doesn't use up the faction's free capital changemovecapital <faction> [name...]confirm/faction setcapital, at no cost, and does not count as a capital movesetcolour <faction> <R,G,B>setbanner <faction>set <faction> <culture|religion|rulingsystem|rulertitle> <value...>kick <faction> <character>forceleaderfirst)quarantine .../guild admin:info,rename,setcolour,setbanner,kick(back to the faction's main guild). The main guild is refused with a pointer to the/faction adminequivalent.Tab completion covers subcommands, faction and guild ids, settlement ids (plus
capital), current colour,setfields and member names (multi-word too).TreasuryTopology.capitalgains an overload withcountMove; the existing signature passestrue, so player moves are unchanged.Known limitation (shared with the player commands)
/faction admin kickand/guild admin kickremove the member exactly as/faction kickand/guild kickdo. Like those, they don't clear council, election or movement entries, dividend eligibility or warband membership; the death path does. Office holders such as the Spymaster are re-checked when used, so nothing breaks, but stale entries can remain. Fixing this belongs in the shared kick path, not just the staff one.Testing
StaffAdminServiceTest(20) andStaffAdminCommandTest(15), with 100% line coverage of the new classes, plus aTreasuryTopologyTestcase showing a staff move is free and leavescapital movesunchanged. Routing and completion tests were updated.mainalready has 515 failing tests (fsync and POSIX permissions). This branch adds only the newTreasuryTopologyTestcase, which fails on Windows the same way as its siblingcapitalLossRevalidates.... Linux CI is authoritative.<placeholder>values were accepted;renamesettlement Sunsora capital Sunsora_Castle; the web map export then showed "Sunsora Castle".who→ guild kick → faction kick, with the target told each time.Capital changes madestayed at 0.[StaffAdmin]log lines and no SimpleFactions errors. Dev's SimpleFactions data was restored afterwards.No wiki change: these are staff-only tools.
🤖 Generated with Claude Code