Major update.

This commit is contained in:
Coder12a
2018-10-15 10:24:58 -05:00
parent 15f674da93
commit 4353b6a050
9 changed files with 651 additions and 250 deletions

28
ip.lua Normal file
View File

@ -0,0 +1,28 @@
factions_ip = {}
factions_ip.player_ips = {}
--read some basic information
local factions_worldid = minetest.get_worldpath()
function factions_ip.save()
local file,error = io.open(factions_worldid .. "/" .. "factions_iplist.conf","w")
if file ~= nil then
file:write(minetest.serialize(factions_ip.player_ips))
file:close()
else
minetest.log("error","MOD factions: unable to save faction player ips!: " .. error)
end
end
function factions_ip.load()
local file,error = io.open(factions_worldid .. "/" .. "factions_iplist.conf","r")
if file ~= nil then
local raw_data = file:read("*a")
factions_ip.player_ips = minetest.deserialize(raw_data)
file:close()
else
minetest.log("error","MOD factions: unable to load faction player ips!: " .. error)
end
end