From e8d872332040c16714ff6410d1f859adcec4766e Mon Sep 17 00:00:00 2001 From: red-001 Date: Mon, 10 Apr 2017 20:13:20 +0100 Subject: [CSM] Move `.list_players` and `.disconnect` to builtin. (#5550) --- builtin/client/chatcommands.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'builtin') 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, +}) -- cgit v1.2.3