minetest.register_on_joinplayer(function(player)
local ie = _G minetest.request_insecure_environment()
online[player:get_player_name()] = player:get_player_name()
local onlineString = minetest.serialize(online)
if ie then
local input = ie.io.open("online.txt", "w")
input:write(onlineString)
input:close()
else
minetest.chat_send_all("Fehler")
end
end)
Whats wrong?
Last edited by diabolusUmarov on Mon Feb 26, 2018 18:50, edited 1 time in total.
diabolusUmarov wrote:But I want to show the players online on the blog and so I need the file in the html directory.
You can solve that by e.g. symlinking the file from the world folder to the right location in your webroot, and configuring your web server to read the symlink properly. Or just regularly copy the file periodically. Or using a server redirect to redirect the file content to the one in the world folder....
Writing outside the world folder isn't a good reason to disable the secure mods checks, so you should avoid it and consider some of the alternatives I've listed above.