Skip to content
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

minetest.player_exists returns true after player was removed with minetest.remove_player #5865

Closed
Wuzzy2 opened this issue May 31, 2017 · 5 comments
Assignees
Labels
Bug Issues that were confirmed to be a bug
Milestone

Comments

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented May 31, 2017

In the Lua API, if you call minetest.player_exists after calling minetest.remove_player on the same player, minetest.player_exists always returns true.

How to reproduce:

  • Start server with luacmd mod enabled
  • Let player “abc” join
  • Let player “abc” leave
  • Let player “admin” join
  • As the player “admin”, use these commands:
/lua print(dump(minetest.player_exists("abc"))
/lua print(dump(minetest.remove_player("abc"))
/lua print(dump(minetest.player_exists("abc"))
  • Make sure the player “abc” did not join while entering above commands

Expected output:

true
0
false

Actual output:

true
0
true

Observations:

  • If you restart the server again after entering the final command, then you try to do /lua print(dump(minetest.player_exists("abc")) once again, you still get true returned.
  • If you let player “abc” join again, the player spawns as if a new player; all items and stuff are gone (expected behaviour)

It seems, as soon as the player “abc” joined at any point in the server's history, minetest.player_exists will start to return true for that player no matter what.

Tested in: 1681a00

@sfan5 sfan5 added the Bug Issues that were confirmed to be a bug label May 31, 2017
@nerzhul
Copy link
Member

nerzhul commented Jun 1, 2017

remove_player doesn't remove auth, it just removed player data, not account data in fact, it's subtile a difference

@rubenwardy
Copy link
Member

rubenwardy commented Jun 2, 2017

I think that it should also remove auth, or player_exists should check for a player entry

@Wuzzy2
Copy link
Contributor Author

Wuzzy2 commented Jun 2, 2017

I think this is a gotcha. Care to fix lua_api.txt (as I have a poor understanding of the inner workings)?

I am also fine with rubenwardy's suggestion.

@rubenwardy
Copy link
Member

A documentation change would be best this late in the release cycle

@nerzhul nerzhul added this to the 0.4.16 milestone Jun 3, 2017
@nerzhul nerzhul added this to Bugs in Minetest 0.4.16 Jun 3, 2017
@ShadowNinja
Copy link
Member

e4d3639

@nerzhul nerzhul closed this as completed Jun 3, 2017
@nerzhul nerzhul moved this from Bugs to Done in Minetest 0.4.16 Jun 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that were confirmed to be a bug
Projects
No open projects
Development

No branches or pull requests

5 participants