aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua45
1 files changed, 45 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index cb53412..1893f77 100644
--- a/init.lua
+++ b/init.lua
@@ -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")
+
+
+
+
+
+
+
+
+
+
+