Improve handling of offline players during events
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Empieza leyendo AbstractEvent, MCPlayerEvent, Static.GetPlayer() y Static.GetCommandSender(), y compara después el manejo de player_login y player_spawn. Aclara el comportamiento esperado para los jugadores offline y los jugadores missing-byName, ten en cuenta las extensiones y añade una cobertura exhaustiva; se considera terminado cuando las búsquedas en el contexto del evento y el comportamiento del entorno de binding están definidos y verificados explícitamente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Java
- Estrellas
- 128
- Forks
- 70
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de EngineHub/CommandHelper
-
discussion wanted documentation
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
EngineHub/CommandHelper#1403 ·
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
EngineHub/CommandHelper#1354 ·
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
EngineHub/CommandHelper#1349 · 3 comentarios ·
-
bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
EngineHub/CommandHelper#1341 · 2 comentarios ·
-
bug discussion wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
EngineHub/CommandHelper#1338 · 2 comentarios ·
Todos los issues de EngineHub/CommandHelper
Issues similares
-
certification
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Abiertobug ecr
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Needs: Triage Type: Feature request
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
github/copilot-sdk#2760 ·