Improve handling of offline players during events
まだ誰も着手していません。
評価
調査の方向性
まず AbstractEvent、MCPlayerEvent、Static.GetPlayer()、Static.GetCommandSender() を読み、player_login と player_spawn の処理を比較します。offline のプレイヤーと missing-byName のプレイヤーに対して期待される動作を明確にし、拡張機能を考慮して包括的なカバレッジを追加します。完了の条件は、イベントコンテキストでの lookup と bind-environment の動作が明示的に定義され、検証されていることです。
索引モデルが issue の本文から書いたものです。
説明
Some events pass a player object for players that are missing from the player list during the event. This causes a CREPlayerOfflineException when getting these players from Static.GetPlayer() or Static.GetCommandSender(), as well as made it tricky to pass the player to the bind environment. This was originally solved by hijacking the player injection system used for capture_runas(), but it wasn't designed for this.
Now, after some changes, the player is added to the environment from MCPlayerEvent instead, but injection is still used for getting players by name (and as a fallback for environment adding). But this happens in AbstractEvent, and this is undesirable as it mixes MC and MethodScript stuff. This will need to be changed some day in the future, but extensions would need to be considered.
Two events use injection still: player_login, where the player is not yet added to the player list at all; and player_spawn where the player is missing from the byName player map but not the byUUID player map (byUUID determines whether the player is "online" or not), which means they're technically online but Static.GetPlayer() can't find them without injection. I consider the player_spawn situation a bug, so it might be better to move the workaround for this to the bukkit abstraction layer.
As for player_login, the player is technically offline, so I'm not sure what the expectation should be here. Due to this, currently you can run functions from player context but not by name, except functions that take a CommandSender instead. (e.g. has_permission(<playerName>, <permissionNode>)) We could change Static.GetPlayer() to take an environment object for situations like this (is player_login the only one?), but that'll affect a lot of functions and some will malfunction in unknown ways for truly offline players. I haven't done a comprehensive test.
- 主要言語
- Java
- スター
- 129
- フォーク
- 70
- 平均マージ
- 1分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
EngineHub/CommandHelper のほかの issue
-
discussion wanted documentation
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
EngineHub/CommandHelper#1403 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
EngineHub/CommandHelper#1354 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
EngineHub/CommandHelper#1349 · コメント 3 件 ·
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
EngineHub/CommandHelper#1341 · コメント 2 件 ·
-
bug discussion wanted
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
EngineHub/CommandHelper#1338 · コメント 2 件 ·
EngineHub/CommandHelper の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
checkstyle/checkstyle#22914 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
component/data-layer
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
opentelemetry_exporter_otlp-1.40.0-py3-none-any.whl: 3 vulnerabilities (highest severity is: 6.5)オープンMend: dependency security vulnerability untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 77/100
opensearch-project/data-prepper#7314 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100