Skip to content

Commit e8d8723

Browse files
red-001nerzhul
authored andcommittedApr 10, 2017
[CSM] Move .list_players and .disconnect to builtin. (#5550)
1 parent 0bc306e commit e8d8723

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed
 

‎builtin/client/chatcommands.lua

+15
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,18 @@ core.register_on_sending_chat_messages(function(message)
3434

3535
return true
3636
end)
37+
38+
core.register_chatcommand("list_players", {
39+
description = "List online players",
40+
func = function(param)
41+
local players = table.concat(core.get_player_names(), ", ")
42+
core.display_chat_message("Online players: " .. players)
43+
end
44+
})
45+
46+
core.register_chatcommand("disconnect", {
47+
description = "Exit to main menu",
48+
func = function(param)
49+
core.disconnect()
50+
end,
51+
})

‎clientmods/preview/init.lua

-13
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,3 @@ core.register_on_punchnode(function(pos, node)
126126
return false
127127
end)
128128

129-
-- This is an example function to ensure it's working properly, should be removed before merge
130-
core.register_chatcommand("list_players", {
131-
func = function(param)
132-
core.display_chat_message(dump(core.get_player_names()))
133-
end
134-
})
135-
136-
core.register_chatcommand("disconnect", {
137-
description = "Exit to main menu",
138-
func = function(param)
139-
core.disconnect()
140-
end,
141-
})

0 commit comments

Comments
 (0)
Please sign in to comment.