Improve documentation around banning (#9088)
* Fix ban chatcommand description * Correct ban API documentation
This commit is contained in:
parent
2907c0f3a2
commit
15a030ec9f
@ -909,8 +909,8 @@ core.register_chatcommand("shutdown", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
core.register_chatcommand("ban", {
|
core.register_chatcommand("ban", {
|
||||||
params = "[<name> | <IP_address>]",
|
params = "[<name>]",
|
||||||
description = "Ban player or show ban list",
|
description = "Ban the IP of a player or show the ban list",
|
||||||
privs = {ban=true},
|
privs = {ban=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if param == "" then
|
if param == "" then
|
||||||
@ -922,7 +922,7 @@ core.register_chatcommand("ban", {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not core.get_player_by_name(param) then
|
if not core.get_player_by_name(param) then
|
||||||
return false, "No such player."
|
return false, "Player is not online."
|
||||||
end
|
end
|
||||||
if not core.ban_player(param) then
|
if not core.ban_player(param) then
|
||||||
return false, "Failed to ban player."
|
return false, "Failed to ban player."
|
||||||
@ -935,7 +935,7 @@ core.register_chatcommand("ban", {
|
|||||||
|
|
||||||
core.register_chatcommand("unban", {
|
core.register_chatcommand("unban", {
|
||||||
params = "<name> | <IP_address>",
|
params = "<name> | <IP_address>",
|
||||||
description = "Remove player ban",
|
description = "Remove IP ban belonging to a player/IP",
|
||||||
privs = {ban=true},
|
privs = {ban=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if not core.unban_player_or_ip(param) then
|
if not core.unban_player_or_ip(param) then
|
||||||
|
@ -4896,13 +4896,16 @@ Server
|
|||||||
Bans
|
Bans
|
||||||
----
|
----
|
||||||
|
|
||||||
* `minetest.get_ban_list()`: returns the ban list
|
* `minetest.get_ban_list()`: returns a list of all bans formatted as string
|
||||||
(same as `minetest.get_ban_description("")`).
|
* `minetest.get_ban_description(ip_or_name)`: returns list of bans matching
|
||||||
* `minetest.get_ban_description(ip_or_name)`: returns ban description (string)
|
IP address or name formatted as string
|
||||||
* `minetest.ban_player(name)`: ban a player
|
* `minetest.ban_player(name)`: ban the IP of a currently connected player
|
||||||
* `minetest.unban_player_or_ip(name)`: unban player or IP address
|
* Returns boolean indicating success
|
||||||
* `minetest.kick_player(name, [reason])`: disconnect a player with a optional
|
* `minetest.unban_player_or_ip(ip_or_name)`: remove ban record matching
|
||||||
|
IP address or name
|
||||||
|
* `minetest.kick_player(name, [reason])`: disconnect a player with an optional
|
||||||
reason.
|
reason.
|
||||||
|
* Returns boolean indicating success (false if player nonexistant)
|
||||||
|
|
||||||
Particles
|
Particles
|
||||||
---------
|
---------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user