diff options
author | Och Noe <och_noe@forksworld.de> | 2024-01-14 02:44:49 +0100 |
---|---|---|
committer | Och Noe <och_noe@forksworld.de> | 2024-01-14 02:44:49 +0100 |
commit | 65521418802bce55e99673d41ae56483a52cfc65 (patch) | |
tree | 5b4b699543d85698b33a490b72a80997eec6ee26 | |
parent | df77095ef5509d3dde54449528f58ddfe60fcfdb (diff) | |
download | colour_chat-master.tar.gz colour_chat-master.tar.bz2 colour_chat-master.zip |
-rw-r--r-- | init.lua | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -178,6 +178,36 @@ end +local cr = minetest.get_csm_restrictions() +local limitationlist = { "load_client_mods", "chat_messages", "read_itemdefs", + "read_nodedefs", "lookup_nodes", "read_playerinfo" } + +local modfunction_limited = {} + +if not cr then + minetest.display_chat_message("cr == nil") + return +else + for _,r in ipairs(limitationlist) do + modfunction_limited[r] = true + if cr[r] then + modfunction_limited[r] = false + end + end +end + +local function show_restrictions() + for _,r in ipairs(limitationlist) do + minetest.display_chat_message(string.format("%-20s: %s",r, (modfunction_limited[r] and "allowed") or "forbidden")) + end +end + +show_restrictions() + +if not modfunction_limited[ "chat_messages" ] then + minetest.display_chat_message( "chat_messages".." are forbidden --> not loading") + return +end local register_on_message = core.register_on_sending_chat_message if core.register_on_sending_chat_messages then @@ -527,3 +557,18 @@ core.register_chatcommand("say", { return true end, }) + + + +minetest.display_chat_message( "[CSM colour_chat] loaded") + + + + + + + + + + + |