aboutsummaryrefslogtreecommitdiff
path: root/builtin/client
diff options
context:
space:
mode:
authorPierre-Adrien Langrognet <upsilon@langg.net>2017-05-21 23:06:51 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-05-21 23:06:51 +0200
commit39f4a2f607d44738d60db84eba4b30e3d7450204 (patch)
tree63a72301d3c53917b99fe0607f48219372f85b6f /builtin/client
parentec490abf5889e06c88887e17f1746043de3b10fe (diff)
downloadminetest-39f4a2f607d44738d60db84eba4b30e3d7450204.tar.gz
minetest-39f4a2f607d44738d60db84eba4b30e3d7450204.tar.bz2
minetest-39f4a2f607d44738d60db84eba4b30e3d7450204.zip
[CSM] Add send_chat_message and run_server_chatcommand API functions (#5747)
* [CSM] Add send_chat_message and run_server_chatcommand API functions * Add client-side chat message rate limiting * Limit out chat queue size * [CSM] Add minetest.clear_out_chat_queue API function and .clear_chat_queue chatcommand * Last fixes/cleanups before merge
Diffstat (limited to 'builtin/client')
-rw-r--r--builtin/client/chatcommands.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/builtin/client/chatcommands.lua b/builtin/client/chatcommands.lua
index f425216f5..2b8cc4acd 100644
--- a/builtin/client/chatcommands.lua
+++ b/builtin/client/chatcommands.lua
@@ -51,3 +51,15 @@ core.register_chatcommand("disconnect", {
core.disconnect()
end,
})
+
+core.register_chatcommand("clear_chat_queue", {
+ description = core.gettext("Clear the out chat queue"),
+ func = function(param)
+ core.clear_out_chat_queue()
+ return true, core.gettext("The out chat queue is now empty")
+ end,
+})
+
+function core.run_server_chatcommand(cmd, param)
+ core.send_chat_message("/" .. cmd .. " " .. param)
+end