From 060b810c521ace77f4f287ec2c8fd4daf51d63d5 Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Tue, 28 Jul 2015 22:27:02 +0200 Subject: [PATCH] Removed classes' save system to unlock class determination at reboot --- mods/pclasses/init.lua | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/mods/pclasses/init.lua b/mods/pclasses/init.lua index a1f3607c..43fc8c90 100755 --- a/mods/pclasses/init.lua +++ b/mods/pclasses/init.lua @@ -31,40 +31,6 @@ dofile(minetest.get_modpath("pclasses") .. "/api.lua") ---------------------------- --- Backup and load system --- - --- Startup -local pfile = io.open(pclasses.conf.datafile, "r") -if pfile then - local line = pfile:read() - if line then - pclasses.datas.players = minetest.deserialize(line) - end - pfile:close() -end - --- Frequent backup -local function save_datas() - local pfile = io.open(pclasses.conf.datafile, "w") - pfile:write(minetest.serialize(pclasses.datas.players)) - pfile:close() - minetest.log("action", "[PClasses] Datas saved") -end - -local save_timer = 0 -minetest.register_globalstep(function(dtime) - save_timer = save_timer + dtime - if save_timer >= pclasses.conf.save_interval then - save_datas() - save_timer = 0 - end -end) -minetest.register_on_shutdown(save_datas) - - - ------------------ -- Default class --