Improve handling of offline players during events
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu bằng cách đọc AbstractEvent, MCPlayerEvent, Static.GetPlayer() và Static.GetCommandSender(), sau đó so sánh cách xử lý player_login và player_spawn. Làm rõ hành vi dự kiến đối với người chơi offline và người chơi missing-byName, tính đến các extension và bổ sung phạm vi kiểm thử toàn diện; công việc được xem là hoàn tất khi các lookup trong ngữ cảnh sự kiện và hành vi của bind-environment được định nghĩa và xác minh một cách rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 128
- Fork
- 70
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của EngineHub/CommandHelper
-
discussion wanted documentation
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
EngineHub/CommandHelper#1403 ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
EngineHub/CommandHelper#1354 ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
EngineHub/CommandHelper#1349 · 3 bình luận ·
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
EngineHub/CommandHelper#1341 · 2 bình luận ·
-
bug discussion wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
EngineHub/CommandHelper#1338 · 2 bình luận ·
Tất cả issue của EngineHub/CommandHelper
Issue tương tự
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Đang mởarea/plugin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Add canonical URLs and a sitemap Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/rocketmq-dashboard#5064 ·
-
Consent portal: creating a duplicate Purpose shows a generic error instead of "already exists" Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
wso2/dpdp-accelerator#287 ·