1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

[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
This commit is contained in:
Pierre-Adrien Langrognet 2017-05-21 23:06:51 +02:00 committed by Loïc Blot
parent ec490abf58
commit 39f4a2f607
9 changed files with 111 additions and 6 deletions

View file

@ -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