1
0
mirror of https://github.com/SmallJoker/minetest-u_skinsdb.git synced 2025-07-15 14:30:23 +02:00

first commit

This commit is contained in:
dmonty2
2014-03-16 22:26:58 -07:00
parent 5e58108006
commit 62be356cab
617 changed files with 679 additions and 0 deletions

28
u_skins/players.lua Normal file
View File

@ -0,0 +1,28 @@
u_skins.file = minetest.get_worldpath() .. "/u_skins.mt"
u_skins.load = function()
local input = io.open(u_skins.file, "r")
local data = nil
if input then
data = input:read('*all')
end
if data and data ~= "" then
lines = string.split(data,"\n")
for _, line in ipairs(lines) do
data = string.split(line, ' ', 2)
u_skins.u_skins[data[1]] = data[2]
end
io.close(input)
end
end
u_skins.load()
u_skins.save = function()
local output = io.open(u_skins.file,'w')
for name, skin in pairs(u_skins.u_skins) do
if name and skin then
output:write(name .. " " .. skin .. "\n")
end
end
io.close(output)
end