Configurable stealthing of online players

This commit is contained in:
Aaron Suen 2022-10-06 22:47:37 -04:00
parent 74f936860c
commit a8410a4d7a

View File

@ -11,13 +11,16 @@ local timedelay = tonumber(minetest.settings:get(modname .. "_time")) or 300
local linedelay = tonumber(minetest.settings:get(modname .. "_lines")) or 25
local maxnames = tonumber(minetest.settings:get(modname .. "_names")) or 50
local stpriv = minetest.settings:get(modname .. "_hide") or "stealth"
local function isstealth(p) return minetest.check_player_privs(p, stpriv) end
local lines = 0
local exp = 0
local function announce()
local names = {}
for _, player in pairs(minetest.get_connected_players()) do
if not minetest.check_player_privs(player, "stealth") then
if not isstealth(player) then
names[#names + 1] = player:get_player_name()
end
end