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

Auth handler: Player deletion & Iterator #6741

Merged
merged 2 commits into from Dec 6, 2017

Conversation

sfan5
Copy link
Member

@sfan5 sfan5 commented Dec 5, 2017

No description provided.

Copy link
Member

@rubenwardy rubenwardy left a 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
Copy link
Member

@rubenwardy rubenwardy Dec 5, 2017

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

Copy link
Member Author

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

Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Member

@rubenwardy rubenwardy left a 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.
Copy link
Member

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`.
@SmallJoker SmallJoker merged commit 4edf087 into minetest:master Dec 6, 2017
@sfan5 sfan5 deleted the auth_changes2 branch December 6, 2017 17:06
t0ny2 pushed a commit to t0ny2/minetest that referenced this pull request Jan 23, 2018
* 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`.
osjc pushed a commit to osjc/minetest that referenced this pull request Jan 11, 2019
* 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`.
osjc pushed a commit to osjc/minetest that referenced this pull request Jan 23, 2019
* 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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants