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
Auth handler: Player deletion & Iterator #6741
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some documentation suggestions.
I wonder if it's worth adding a function like minetest.get_player_auth_iterator()
doc/lua_api.txt
Outdated
* Returns a code (0: successful, 1: no such player, 2: player is connected) | ||
* `minetest.remove_player_auth(name)`: remove player authentication data | ||
* Returns boolean indicating success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should note that it will return false if the player doesn't exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought that was obvious since you can't successfully remove a nonexistant player
will add though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen similar (non-MT) APIs doing it either way, so it's good to mention
doc/lua_api.txt
Outdated
@@ -5225,6 +5228,8 @@ Definition tables | |||
create_auth = func(name, password), | |||
-- ^ Create new auth data for player `name` | |||
-- ^ Note that `password` is not plain-text but an arbitrary representation decided by the engine | |||
delete_auth = func(name), | |||
-- ^ Delete auth data of player `name`, returns boolean indicating success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 when this is done
doc/lua_api.txt
Outdated
@@ -3124,8 +3124,11 @@ These functions return the leftover itemstack. | |||
* `minetest.get_server_status()`: returns server status string | |||
* `minetest.get_server_uptime()`: returns the server uptime in seconds | |||
* `minetest.remove_player(name)`: remove player from database (if he is not connected). | |||
* Does not remove player authentication data, minetest.player_exists will continue to return true. | |||
* As auth data is not removed, minetest.player_exists will continue to return true. | |||
Call the below method if you want to remove auth data too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call the below method as well
There was no way to do this previously and a recent commit broke doing this the "hacky" way by accessing `core.auth_table`.
* Add player deletion method to auth handler (fixes minetest#6653) * Support iterating over the auth database There was no way to do this previously and a recent commit broke doing this the "hacky" way by accessing `core.auth_table`.
* Add player deletion method to auth handler (fixes minetest#6653) * Support iterating over the auth database There was no way to do this previously and a recent commit broke doing this the "hacky" way by accessing `core.auth_table`.
* Add player deletion method to auth handler (fixes minetest#6653) * Support iterating over the auth database There was no way to do this previously and a recent commit broke doing this the "hacky" way by accessing `core.auth_table`.
No description provided.