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
Reorder client initialization #12189
Conversation
19ef736
to
7186307
Compare
This is not the same issue as #12073, is it? |
Actually yes, it seems to be the same issue. |
The other report came from a faulty third party client causing the engine to become confused. If this one is reproducible in the normal client then it's not the same issue. |
It is the same as in #12073 (comment) but reproducible at a chance with the official Minetest client. |
|
@SmallJoker rebase needed |
7186307
to
a593404
Compare
IRC discussion: https://irc.minetest.net/minetest-dev/2023-03-05#i_6060589 (in short, it'll wait a bit) |
Previously, ServerEnv created a player instance before they're fully initialized. This commit moves all initialization steps and callbacks into TOSERVER_CLIENT_READY ^ which includes StageTwoClientInit for player loading or creation
a593404
to
3362ab6
Compare
For some reason I can no longer reproduce the bug in master, even though the relevant code does not seem to have changed in any meaningful way. This PR no longer seems to be necessary. |
Before
minetest.get_connected_players
occasionally returns object references of yet-not-joined players, for example inminetest.register_globalstep
callbacks. This is a problem becauseminetest.register_on_joinplayer
was not called yet.Mods rely on joinplayer to initialize their API entries, which causes unpredictable and unreliable code paths.
After
minetest.get_connected_players
includes the player reference only after (and including)minetest.register_on_newplayer
, followed byminetest.register_on_joinplayer
.Fixes the root issue of minetest-mods/playeranim#3
To do
This PR is Ready for Review.
How to test