Skip to content

Commit

Permalink
add missing file, updated privs in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed May 4, 2020
1 parent 2966cfc commit 96f95b9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ The current mapblock-stats can be viewed with `/mesecons_hud on`

* none yet

## Privs

* **mesecons_debug** Allows execution of mesecon debug chatcommands

## Commands

All of these commands require the `mesecons_debug` privilege.
Expand Down
21 changes: 21 additions & 0 deletions whitelist.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
local filename = minetest.get_worldpath() .. "/mesecons_debug_whiltelist"

function mesecons_debug.save_whitelist()
local file = io.open(filename,"w")
local data = minetest.serialize(mesecons_debug.whitelist)
if file and file:write(data) and file:close() then
return
else
minetest.log("error","mesecons_debug: save failed")
return
end
end

function mesecons_debug.load_whitelist()
local file = io.open(filename, "r")

if file then
local data = file:read("*a")
mesecons_debug.whitelist = minetest.deserialize(data) or {}
end
end

0 comments on commit 96f95b9

Please sign in to comment.