Improve handling of offline players during events
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
Piste de recherche
Commencez par lire AbstractEvent, MCPlayerEvent, Static.GetPlayer() et Static.GetCommandSender(), puis comparez la gestion de player_login et de player_spawn. Clarifiez le comportement attendu pour les joueurs offline et les joueurs missing-byName, prenez en compte les extensions et ajoutez une couverture complète ; le travail est considéré comme terminé lorsque les recherches dans le contexte de l’événement et le comportement de l’environnement de binding sont explicitement définis et vérifiés.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Java
- Étoiles
- 128
- Forks
- 70
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de EngineHub/CommandHelper
-
discussion wanted documentation
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
EngineHub/CommandHelper#1403 ·
-
bug
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
EngineHub/CommandHelper#1354 ·
-
bug
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
EngineHub/CommandHelper#1349 · 3 commentaires ·
-
bug
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
EngineHub/CommandHelper#1341 · 2 commentaires ·
-
bug discussion wanted
Difficulté 4/5 3-5 jours Accessibilité débutants 42/100
EngineHub/CommandHelper#1338 · 2 commentaires ·
Toutes les issues de EngineHub/CommandHelper
Issues similaires
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
apache/flink-agents#1152 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
jenkinsci/blueocean-plugin#5417 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
objectionary/eo-graphs#75 ·