You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When a script listens to the onPlayerAuth event and learns about it eg by adding it to a table
then this onPlayerDisconnected event will never be called if this or another script of another state rejects the players in onPlayerAuth, because the player was rejected before they have gotten an ID. This leads to the problematic that a script will endup with players in their tables that dont exist anymore.
This was an issue in the official events. The events script was rejecting players in onPlayerAuth but the RaceManager² kept them in their tables because they learned about the players in onPlayerAuth and removed them in onPlayerDisconnected, which ofc wasnt called as another script state rejected them.
Describe the solution you'd like
This problem could be solved by introducing the onPlayerRejected event, which would be called on every state if any state rejected a player in onPlayerAuth
Have you tried/looked at postPlayerAuth in the latest pre-release? That should do what you want.
It takes the same arguments as the normal event, except there is a new argument before all the others that tells you whether the event went through (true) or was cancelled (false).
I did not see this event yet no.
So if i understand #364 right then
postPlayerAuth is called after every state had the chance to execute onPlayerAuth no matter if the player was accepted or rejected
but the new arg of the event contains a boolean that tells us if the player was rejected or not
If the case, then this can be closed yes. Cause a script can listen to either just postPlayerAuth to learn about a player or remove it at that point if they learned about it before
Is your feature request related to a problem? Please describe.
When a script listens to the onPlayerAuth event and learns about it eg by adding it to a table
and removes it with the onPlayerDisconnected event
then this onPlayerDisconnected event will never be called if this or another script of another state rejects the players in onPlayerAuth, because the player was rejected before they have gotten an ID. This leads to the problematic that a script will endup with players in their tables that dont exist anymore.
This was an issue in the official events. The events script was rejecting players in onPlayerAuth but the RaceManager² kept them in their tables because they learned about the players in onPlayerAuth and removed them in onPlayerDisconnected, which ofc wasnt called as another script state rejected them.
Describe the solution you'd like
This problem could be solved by introducing the onPlayerRejected event, which would be called on every state if any state rejected a player in onPlayerAuth
Describe alternatives you've considered
So the only current way to unlearn of players is to routinely check if the players are still present by eg
The text was updated successfully, but these errors were encountered: