feat(oyasaitoken): unify token commands and add durable notifications - #915
Merged
Conversation
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
トークン付与時にプレイヤーへ通知が出ない問題(投票報酬でポイントが入っても本人に表示されない)を、コマンド体系・権限・通知基盤ごと作り直す。
コミットA
224f75d6— コマンドと権限の統合/token1本に統合。/tmと別名tokens/tokenmanagerを廃止give/delete/take/sendall等)は実装しないtransferサブコマンドを削除。/tm transfer confirmは3つの移行ガードを全て迂回してledger.replaceAllするため、移行完了後の現在は残高を巻き戻すだけの危険な経路だった。起動時の自動インポート(ガードあり)は残す
token.use(default true)/token.admin(default op)の2ノードに統合。旧ノードは
plugin.ymlのchildrenでマップするので既存の LuckPerms 設定は無変更で動く/token balance <他人>をtoken.admin側へ。従来は誰でも他人の残高を閲覧できていたpoints-commandをtoken add %player% %points% -sに追随コミットB
7406f282— 永続的な通知token_notification_outboxを追加し、残高・token_transactionsと同一トランザクションで書く-s=抑止 / Player・UUID API=常に無通知 /String 版 API は
silent引数を尊重)。設定で一括 ON にはできないnotifications.yml(既定enabled: false、schema-version検証、日本語フォールバック)公開 API のシグネチャは15メソッドすべて変更なし。
me.realized.*互換層・ServicesManager 登録も維持。依存プラグイン(OyasaiPets / SocialLikes3 / OyasaiMenu / DynamicProfile / OyasaiAdminTools /
OyasaiUtilities)はコード変更なし。
デプロイ時の注意
/tmを廃止するため、本番のみに存在する以下5ファイルを JAR と同じ停止ウィンドウ内で同時に更新する必要がある。片方だけ入れ替えると全報酬経路が停止する。
plugins/zVoteParty/config.yml(5行)tm add→token addplugins/Skript/scripts/Guidance.sk:94tm add→token addplugins/Skript/scripts/vote-token-spill.sk:13tm add→token addplugins/OyasaiMusic/config.yml:41→token add %player% %points% -splugins/OyasaiAdminTools/surveys.json:25→token add %player% 20LuckPerms は否定ノード0件・
token.*既存0件のため作業不要(本番 DB 確認済み)。Test plan
./gradlew :plugins:OyasaiToken:build/ OyasaiMusic ビルドnix fmt差分なしtoken addで本人に通知が出るtoken add ... -sで本人に出ない/実行者には結果が出るremove/set/balance/top/sendenabled: falseで通知が出ず残高更新は継続/token transferが Usage・tab 補完に存在しないtm/tokens/tokenmanagerが未登録🤖 Generated with Claude Code