feat: PAPI плейсхолдеры команды#11
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3febcad31c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| val online = player?.player ?: return "" | ||
| val style = safe { MiniGamesAPI.getCurrentTeamStyle(online) } |
There was a problem hiding this comment.
Cache team styles for placeholder requests
When these placeholders are used by a tab list or scoreboard, this line runs for every rendered player and placeholder refresh; MiniGamesAPI.getCurrentTeamStyle() calls getTeamStyle(), and TeamStyleProvider.get() reloads minigamesapi/config.yml via YamlConfiguration.loadConfiguration(...) on each call. In common configs like %joutak_games_team_color%[%joutak_games_team_name%], that creates repeated disk I/O on the placeholder hot path and can stall the server main thread, so the integration should cache/preload team styles or expose the snapshotted team index separately from the file-backed style lookup.
Useful? React with 👍 / 👎.
material/color/name живут в config.yml: teamselect.teams.<n>, единый источник правды для GUI выбора, лобби-скорборда и режимов. Добавлен публичный API TeamStyle/TeamStyleProvider — моды читают стили оттуда вместо хардкода. v4-миграция: переносит имена из messages.yml: ui.teamselect.teams.<n>.name в config.yml: teamselect.teams.<n>.name (если в config ещё нет), затем вырезает legacy-секцию из messages.yml. Existing моды визуально не меняются. Voicechat-интеграция (TeamGroupManager) использует новый API для имени команды вместо собственного парсера messages.yml. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Группы распускаются на конце матча: новый MatchResultRecordingEvent фаерится из MiniGamesAPI.recordMatchResult, TeamGroupManager сносит группы в этот момент (типично — после церемонии). GameInstanceEndedEvent остаётся страховкой для модов, не зовущих recordMatchResult. - JoinGroupEvent guard: в группу пускает только своих участников команды и зарегистрированных наблюдателей. TeamGroupManager хранит groupOwnerByGroupId / playerOriginalGroup / spectatorAccess; всё чистится при teardown. Без паролей — игрок может выйти из группы и вернуться (своей) без участия админа. - Public API на MiniGamesAPI: allowVoiceSpectator/revokeVoiceSpectator (мод регистрирует наблюдателей) и findActiveMatchInstance (helper для поиска инстанса по игроку). Вызов идёт через VoiceSpectatorRegistry — cross-package indirection, чтобы не тянуть de.maxhenkel.* классы на серверах без SVC. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3febcad to
1998f1e
Compare
No description provided.