aboutsummaryrefslogtreecommitdiff
path: root/builtin/client
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2018-12-24 10:51:10 +0100
committerGitHub <noreply@github.com>2018-12-24 10:51:10 +0100
commita5197eaebc61ac6b555a640f36c0b427faef381d (patch)
tree48b4deb787731aba6b2c7f50e3664420cdbe94db /builtin/client
parent9080d7c990e9efd52c418369c83dd365837f2f05 (diff)
downloadminetest-a5197eaebc61ac6b555a640f36c0b427faef381d.tar.gz
minetest-a5197eaebc61ac6b555a640f36c0b427faef381d.tar.bz2
minetest-a5197eaebc61ac6b555a640f36c0b427faef381d.zip
CSM: add requested CSM_RF_READ_PLAYERINFO (#8007)
* CSM: add requested CSM_RF_READ_PLAYERINFO This new CSM limit permit to limit PLAYERINFO read from server. It affects get_player_names call
Diffstat (limited to 'builtin/client')
-rw-r--r--builtin/client/chatcommands.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin/client/chatcommands.lua b/builtin/client/chatcommands.lua
index ed43a6140..201ca4a9b 100644
--- a/builtin/client/chatcommands.lua
+++ b/builtin/client/chatcommands.lua
@@ -40,8 +40,13 @@ end)
core.register_chatcommand("list_players", {
description = core.gettext("List online players"),
func = function(param)
- local players = table.concat(core.get_player_names(), ", ")
- core.display_chat_message(core.gettext("Online players: ") .. players)
+ local player_names = core.get_player_names()
+ if not player_names then
+ return false, core.gettext("This command is disabled by server.")
+ end
+
+ local players = table.concat(player_names, ", ")
+ return true, core.gettext("Online players: ") .. players
end
})