Skip to content

實作 Bukkit 指令、聊天輸入與管理操作 #10

Closed

Description

@Command1264

上層 roadmap:#1

前置項目:#3、#4、#5、#8、#9(均已完成)
後續項目:#11

目標

將既有 Invitation、Invite Code、SQLite、Qualification 與 Reward 領域能力串接成可操作的 Bukkit 插件,提供舊版相容的玩家指令、有限期私密聊天輸入、在地化、安全權限與可稽核管理介面。本 Issue 不實作新版 Dialog;Dialog 與新版豐富文字由 #11 提供。

範圍與固定決策

  • 本 Issue 的可執行 backend 為 SQLite。設定選到尚未完成的 MySQL 或 JSON 時,插件必須顯示可操作的 unsupported 錯誤,不得靜默退回 SQLite 或記憶體。
  • 啟動時不得自動執行 schema migration。資料庫未初始化或版本不符時進入 maintenance mode,只開放 help、doctor、storage migrate 與安全停用所需路徑。
  • Blocking storage、設定檔 I/O 與 Qualification/Reward orchestration 使用插件專用 executor;Bukkit API 呼叫明確切回 server main thread。停用插件時停止接受新工作並有界等待 executor 結束。
  • Claim Confirmation 與 chat capture 是記憶體內短期 session;重啟、取消、逾時或成功後立即失效。任何時刻每名玩家最多一個輸入 session 與一個 confirmation。
  • Chat capture 只攔截該玩家下一則輸入,先取消公開聊天,再把正規化內容送往非同步 workflow;不得記錄原始聊天內容。
  • Reload 先完整驗證 general、qualification、reward 與 locale 設定,再原子替換有效 snapshot;storage backend、路徑或 secret 變更只提示需要重啟。
  • 玩家與管理指令接受 UUID 或唯一的已知玩家名稱;名稱不明或重複時拒絕,不以可能建立新 profile 的模糊離線查詢代替。
  • 所有管理修改都要求非空白 reason,並保存 actor、reason 與 Audit Record/Reward transition。

玩家指令契約

  • /invitecode help:依權限列出可用操作。
  • /invitecode code:建立或顯示自己的 Invite Code。
  • /invitecode claim :驗證 Invite Code 並建立 30 秒 Claim Confirmation;不得直接建立 Invitation。
  • /invitecode claim:在 CHAT/AUTO fallback 且設定允許時開始 60 秒私密 chat capture;COMMAND_ONLY 顯示可操作用法。
  • /invitecode confirm、/invitecode cancel:完成或取消目前 confirmation/input session。
  • /invitecode status:顯示 Claim Eligibility、Invitation 狀態與等待中的 Reward 數量。
  • /invitecode stats:顯示 Inviter 的 claimed/qualified 數量。

玩家專用操作拒絕 Console。未知子指令、參數錯誤、權限不足、設定或 storage 故障都使用在地化且可操作的訊息。

管理指令契約

  • admin inspect player|invitation|reward:唯讀檢查領域狀態與 transition history。
  • admin invitation unlink|transfer|force-qualify:呼叫既有 audited domain transition;Force Qualification 成功後必須進入 Reward planning。
  • admin eligibility reset:重設指定玩家 Claim Eligibility,不隱含 unlink。
  • admin reward retry|mark-delivered:只處理 UNCERTAIN Reward Action。
  • admin code rotate:原子替換 Invite Code,舊碼保持 reserved。
  • admin storage migrate:執行明確 migration,成功後嘗試離開 maintenance mode。
  • admin reload:依前述 snapshot 規則 reload。
  • admin doctor:唯讀回報 configuration、storage schema、executor、PlaceholderAPI、Vault 與 Reward backlog 健康狀態。

實作里程碑

  1. Runtime、版本化設定與 locale snapshot、SQLite lifecycle、executor/main-thread boundary。
  2. 玩家指令、Invite Code lookup、Claim Confirmation、chat capture、status/stats 查詢。
  3. Qualification 觸發、Reward planning、啟動 recovery 與玩家登入 Pending Reward 補發。
  4. 管理指令、maintenance mode、reload、doctor、權限與操作文件。

驗收條件

  • 玩家可查看 Invite Code、透過 command 或有限期私密 chat capture 開始 Claim、確認或取消,並查看 status 與 stats。
  • 無效、自邀、過期、已是 Inviter、已有 Invitation、逾時與競爭 Claim 都不會建立錯誤關係。
  • Chat capture 在取消、逾時、成功、登出及插件停用後不再攔截訊息,也不會把 Invite Code 公開到聊天。
  • 玩家首次出現時保存 First Seen At 與已知名稱;登入會觸發可安全重試的 Qualification/Pending Reward 工作。
  • Qualification 首次成功後建立冪等 Reward Delivery;重啟先把中斷中的 Reward Action 復原為 UNCERTAIN,再處理安全的 Pending 工作。
  • 管理操作覆蓋 invitation、eligibility、qualification、reward、code 與 storage,所有修改都有 actor、reason 與稽核紀錄。
  • Permission 採安全預設:玩家操作僅授予基本節點,管理節點預設僅 op;每個 handler 仍自行檢查精確 permission。
  • 繁體中文與英文訊息涵蓋所有成功、拒絕、逾時、maintenance 與可操作錯誤;缺少 locale key 時安全退回預設語言並記錄 key。
  • 無效 reload 保留上一份有效 snapshot;storage 設定變更不熱切換 backend。
  • 自動測試涵蓋 command routing、session lifecycle、placeholder/locale fallback、main-thread 邊界、storage failure、重啟 recovery 與管理稽核;SQLite integration test 涵蓋新增查詢。
  • Java 8 與 Java 11 均通過 check shadowJar,產物維持 Java 8 bytecode。跨 Minecraft 版本真實伺服器矩陣由 #12 驗收。

文件

同步更新 README、CHANGELOG、玩家/管理指令、設定、permission、maintenance、migration、Reward recovery 與人工驗收說明。

Activity

  1. added
    needs-triage
    on Sep 20, 2026
  2. changed the title [-]Bukkit commands, chat input, and admin controls[/-] [+]實作 Bukkit 指令、聊天輸入與管理操作[/+] on Sep 20, 2026
  3. added
    ready-for-agent
    and removed
    needs-triage
    on Sep 22, 2026
  4. Command1264 commented on Sep 22, 2026

    @Command1264
    OwnerAuthor

    Issue #10 的實作與自動驗證已完成:

    • 功能 PR feat: 實作 Bukkit 邀請工作流程 #19 已合併至 develop,merge commit 為 ab3d36ccac15701db712efa3be4d6e3f61933252。
    • PR feat: 實作 Bukkit 邀請工作流程 #19 的 Ubuntu/Windows × Java 8/11 四組 CI 全數通過。
    • 測試整合 PR test: 建立真實伺服器測試矩陣 #20(head 85e0da0646b5356992665a0f57f017348fa9e40f)已建立,四組 CI 全數通過。
    • Spigot 1.8.8、1.12.2、1.16.5、最新版,以及 Paper 1.20.6、1.21.8、最新版,共七個可用 profile 的啟動、停機、設定初始化與 SQLite smoke test 通過。
    • Spigot 1.8.8 與 Paper 最新版完成重新啟動持久化測試;SQLite DB 與 anti-abuse key 沒有被重建。
    • Console 的 /ic help、/ic reload、/ic admin doctor、/ic status smoke test 通過;status 正確回覆只能由玩家使用,未出現 command exception 或缺少語系訊息。
    • Folia profile 與流程已保留,但 PaperMC 目前沒有可用的穩定 Folia 26.2 核心,因此沒有宣稱完成 Folia runtime 驗證。

    完整證據記錄於 自動 smoke test 證據。依目前測試政策,真人互動測試集中到接近發行時進行,不作為本 Issue 的完成阻擋條件。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions