This commit is contained in:
Alexsandro Percy 2022-03-13 14:01:42 -03:00
parent aebbf70bb3
commit aff641580a

View File

@ -1,7 +1,6 @@
local server = nil
local data, ip, port
local wait_timer = 0
local play_flag = {}
modname = minetest.get_current_modname()
modpath = minetest.get_modpath(modname)
@ -117,26 +116,18 @@ minetest.register_globalstep(function(dtime)
local media_options = {filepath = file_path, ephemeral = true}
local media_to_play = filename:gsub("%.ogg", "")
minetest.dynamic_add_media(media_options, function(name)
--minetest.chat_send_all(media_to_play)
if play_flag[media_to_play] == true then
--do nothing
else
play_flag[media_to_play] = true
minetest.sound_play(media_to_play, {
--to_player = nick,
object = player,
max_hear_distance = 30,
gain = 1.0,
fade = 0.0,
pitch = 1.0,
--exclude_player = nick,
}, true)
insecure_environment.os.remove (file_path)
minetest.after(20, function()
play_flag[media_to_play] = nil
end)
end
end)
--minetest.chat_send_all(media_to_play)
minetest.sound_play(media_to_play, {
--to_player = nick,
object = player,
max_hear_distance = 30,
gain = 1.0,
fade = 0.0,
pitch = 1.0,
--exclude_player = nick,
}, true)
insecure_environment.os.remove (file_path)
end)
end
end
end