aboutsummaryrefslogtreecommitdiff
path: root/builtin/client
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2017-04-10 20:13:20 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-04-10 21:13:20 +0200
commite8d872332040c16714ff6410d1f859adcec4766e (patch)
tree2fcbd3e1f947ebbe7e4cc5b86c51d9fd29ca3123 /builtin/client
parent0bc306e3371c4fe2211876156bcbc8a5e2092e22 (diff)
downloadminetest-e8d872332040c16714ff6410d1f859adcec4766e.tar.gz
minetest-e8d872332040c16714ff6410d1f859adcec4766e.tar.bz2
minetest-e8d872332040c16714ff6410d1f859adcec4766e.zip
[CSM] Move `.list_players` and `.disconnect` to builtin. (#5550)
Diffstat (limited to 'builtin/client')
-rw-r--r--builtin/client/chatcommands.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/builtin/client/chatcommands.lua b/builtin/client/chatcommands.lua
index 7a1b4b6b7..bb5b905d8 100644
--- a/builtin/client/chatcommands.lua
+++ b/builtin/client/chatcommands.lua
@@ -34,3 +34,18 @@ core.register_on_sending_chat_messages(function(message)
return true
end)
+
+core.register_chatcommand("list_players", {
+ description = "List online players",
+ func = function(param)
+ local players = table.concat(core.get_player_names(), ", ")
+ core.display_chat_message("Online players: " .. players)
+ end
+})
+
+core.register_chatcommand("disconnect", {
+ description = "Exit to main menu",
+ func = function(param)
+ core.disconnect()
+ end,
+})