Skip to content

Commit

Permalink
[CSM] Move .list_players and .disconnect to builtin. (#5550)
Browse files Browse the repository at this point in the history
  • Loading branch information
red-001 authored and nerzhul committed Apr 10, 2017
1 parent 0bc306e commit e8d8723
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
15 changes: 15 additions & 0 deletions builtin/client/chatcommands.lua
Expand Up @@ -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,
})
13 changes: 0 additions & 13 deletions clientmods/preview/init.lua
Expand Up @@ -126,16 +126,3 @@ core.register_on_punchnode(function(pos, node)
return false
end)
-- This is an example function to ensure it's working properly, should be removed before merge
core.register_chatcommand("list_players", {
func = function(param)
core.display_chat_message(dump(core.get_player_names()))
end
})
core.register_chatcommand("disconnect", {
description = "Exit to main menu",
func = function(param)
core.disconnect()
end,
})

0 comments on commit e8d8723

Please sign in to comment.