Files
Cites_Plugins/docs/diagrams/builtin-commands-diagram.puml
T
Antone Barbaud 002fefdc02 feat: admin/chef/player permission model + leaderless teams + setleader
Commands:
- Drop all short aliases (c/i/t/j/vis/disband/...) — long names only.
- Every /core team <action> now has a crcore.team.<action> permission.
- Three-tier model:
  * Admin (perm only): create, delete, setleader, score
  * Chef (perm + chef-check in execute): add, remove, transfer, visibility, setspawn
  * Player (perm): join, leave, info, list, top
- delete now takes <team> as argument (admin); no more chef-disband shortcut.

New /core team setleader <team> <player>:
- Admin assigns or replaces a team's leader.
- More permissive than transfer: target may not yet be a member (auto-add),
  and works on leaderless teams.

Leaderless teams:
- Team.leaderId is now nullable.
- getLeaderId() and getLeader() return Optional<...>.
- hasLeader() and isLeader(UUID) helpers added.
- New constructors Team(id, name, tag, color [, visibility]) for leaderless.
- TeamService.createTeam overloads without leaderId.
- TeamService.setLeader(teamId, playerId): assigns/replaces leader (auto-adds
  as member if needed). Fires TeamLeadershipTransferEvent with optional old.
- TeamLeadershipTransferEvent.getOldLeaderId() returns Optional<UUID>.
- SqliteTeamRepository: leader_id column no longer NOT NULL.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-09 14:56:07 +02:00

125 lines
3.1 KiB
Plaintext

@startuml builtin-commands-diagram
title CR-Core — Default /core team commands (admin / chef / joueur)
skinparam classAttributeIconSize 0
hide empty members
package "fr.luc.crcore.command" {
abstract class BaseCommand
abstract class SubCommand
}
package "fr.luc.crcore.command.builtin" {
class CoreCommand {
+ CoreCommand(teamSvc, playerSvc)
}
CoreCommand --|> BaseCommand
package "fr.luc.crcore.command.builtin.team" {
class TeamGroupSubCommand {
+ TeamGroupSubCommand(service)
# registerDefaults(): void
}
TeamGroupSubCommand --|> SubCommand
class TeamArgumentTypes <<utility>> {
+ {static} teamByName(service): ArgumentType<Team>
}
' === ADMIN commands (permission seule) ===
package "admin" <<Rectangle>> {
class TeamCreateSubCommand {
perm: crcore.team.create
args: name, tag, color, [leader]
}
class TeamDeleteSubCommand {
perm: crcore.team.delete
args: <team>
}
class TeamSetLeaderSubCommand {
perm: crcore.team.setleader
args: <team> <player>
}
class TeamScoreSubCommand {
perm: crcore.team.score
args: <team> <name> <add|set> <value>
}
}
' === CHEF commands (permission + check chef) ===
package "chef" <<Rectangle>> {
class TeamAddSubCommand {
perm: crcore.team.add
args: <player>
}
class TeamRemoveSubCommand {
perm: crcore.team.remove
args: <player>
}
class TeamTransferSubCommand {
perm: crcore.team.transfer
args: <player>
}
class TeamVisibilitySubCommand {
perm: crcore.team.visibility
args: <vis>
}
class TeamSetSpawnSubCommand {
perm: crcore.team.setspawn
}
}
' === PLAYER commands ===
package "player" <<Rectangle>> {
class TeamJoinSubCommand {
perm: crcore.team.join
args: <team>
}
class TeamLeaveSubCommand {
perm: crcore.team.leave
}
class TeamInfoSubCommand {
perm: crcore.team.info
args: [team]
}
class TeamListSubCommand {
perm: crcore.team.list
}
class TeamTopSubCommand {
perm: crcore.team.top
args: [score]
}
}
TeamCreateSubCommand --|> SubCommand
TeamDeleteSubCommand --|> SubCommand
TeamSetLeaderSubCommand --|> SubCommand
TeamScoreSubCommand --|> SubCommand
TeamAddSubCommand --|> SubCommand
TeamRemoveSubCommand --|> SubCommand
TeamTransferSubCommand --|> SubCommand
TeamVisibilitySubCommand --|> SubCommand
TeamSetSpawnSubCommand --|> SubCommand
TeamJoinSubCommand --|> SubCommand
TeamLeaveSubCommand --|> SubCommand
TeamInfoSubCommand --|> SubCommand
TeamListSubCommand --|> SubCommand
TeamTopSubCommand --|> SubCommand
CoreCommand "1" *-- "1" TeamGroupSubCommand : contains
TeamGroupSubCommand "1" *-- "14" SubCommand : contains
}
}
note bottom of TeamGroupSubCommand
Override d'une feuille :
core.getCoreCommand()
.findSubCommand("team")
.replaceSubCommand("create",
new MyCreate(svc));
end note
@enduml