1
0
mirror of https://e.coding.net/circlecloud/Residence.git synced 2024-10-31 22:38:48 +00:00

add information while load or save file...

Signed-off-by: j502647092 <jtb1@163.com>
This commit is contained in:
j502647092 2015-06-03 23:26:12 +08:00
parent 3e28dc9063
commit 05846a0189

View File

@ -359,6 +359,7 @@ public class Residence extends JavaPlugin {
} }
YMLSaveHelper yml; YMLSaveHelper yml;
File loadFile; File loadFile;
long time = System.currentTimeMillis();
HashMap<String, Object> worlds = new HashMap<String, Object>(); HashMap<String, Object> worlds = new HashMap<String, Object>();
for (World world : server.getWorlds()) { for (World world : server.getWorlds()) {
loadFile = new File(worldFolder, "res_" + world.getName() + ".yml"); loadFile = new File(worldFolder, "res_" + world.getName() + ".yml");
@ -397,10 +398,13 @@ public class Residence extends JavaPlugin {
rentmanager = RentManager.load((Map<String, Object>) yml.getRoot() rentmanager = RentManager.load((Map<String, Object>) yml.getRoot()
.get("RentSystem")); .get("RentSystem"));
} }
this.getLogger().info(
"从配置文件中读取领地数据,耗时" + ((float) (System.currentTimeMillis() - time) / 1000)
+ " 秒)");
// System.out.print("[Residence] Loaded..."); // System.out.print("[Residence] Loaded...");
return true; return true;
} catch (Exception ex) { } catch (Exception ex) {
this.getLogger().warning("领地数据载入时发生错误,请报告下内容给作者: "); this.getLogger().warning("领地数据载入时发生错误,请报告下内容给作者: ");
this.getLogger().warning("错误: " + ex); this.getLogger().warning("错误: " + ex);
throw ex; throw ex;
} }
@ -618,6 +622,7 @@ public class Residence extends JavaPlugin {
File worldFolder = new File(saveFolder, "Worlds"); File worldFolder = new File(saveFolder, "Worlds");
worldFolder.mkdirs(); worldFolder.mkdirs();
YMLSaveHelper yml; YMLSaveHelper yml;
long time = System.currentTimeMillis();
Map<String, Object> save = rmanager.save(); Map<String, Object> save = rmanager.save();
for (Entry<String, Object> entry : save.entrySet()) { for (Entry<String, Object> entry : save.entrySet()) {
File ymlSaveLoc = new File(worldFolder, "res_" + entry.getKey() + ".yml"); File ymlSaveLoc = new File(worldFolder, "res_" + entry.getKey() + ".yml");
@ -714,7 +719,8 @@ public class Residence extends JavaPlugin {
ymlSaveLoc.renameTo(backupFile); ymlSaveLoc.renameTo(backupFile);
} }
tmpFile.renameTo(ymlSaveLoc); tmpFile.renameTo(ymlSaveLoc);
this.getLogger().info(
"保存领地数据到文件中,耗时" + ((float) (System.currentTimeMillis() - time) / 1000) + " 秒)");
if (cmanager.showIntervalMessages()) { if (cmanager.showIntervalMessages()) {
this.getLogger().info(" - 保存插件数据..."); this.getLogger().info(" - 保存插件数据...");
} }