diff options
-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") + + + + + + + + + + + |