-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_connected_players
wrongly returns empty list in register_on_shutdown
#14736
Comments
Possible culprits (not tested yet): e7dbd32 and 32f68f3. @SmallJoker |
related #14711 |
Needless to say we should add some test code to devtest for these cases. |
Since ef0009a, the disconnected players are now unloaded properly explicitly before EDIT:
This behaviour is not documented. Intuitively it would however indeed make sense to me to still have the player list available there - even if they're already gone. |
Indeed we should document it.
It's not just intuition. It's pretty much a necessity if you want to do any player-related things on shutdown, such as persisting data to player meta, since |
Minetest version
Reported by BluebirdGrey51 on IRC on version 5.9.0-dev-87232358d. I can also reproduce this.
Summary
get_connected_players
wrongly returns an empty list inregister_on_shutdown
- 5.8.0 returned a list containing the connected players, as it should. There isn't even a good way for modders to work around this sinceregister_on_leaveplayer
doesn't get run on shutdown. Hence, if modders want to do something with players on shutdown (in BluebirdGrey51's example, setting some metadata values), they need this to work.Steps to reproduce
On 5.8.0: Start singleplayer game. Exit to OS. Output on terminal:
# connected players 1
.Now do the same on 5.9-dev. Output:
# connected players 0
.The text was updated successfully, but these errors were encountered: