From 05846a01891748aadcaecbde26918920aec7efca Mon Sep 17 00:00:00 2001 From: j502647092 Date: Wed, 3 Jun 2015 23:26:12 +0800 Subject: [PATCH] add information while load or save file... Signed-off-by: j502647092 --- src/com/bekvon/bukkit/residence/Residence.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/com/bekvon/bukkit/residence/Residence.java b/src/com/bekvon/bukkit/residence/Residence.java index 3079e43..7955da7 100644 --- a/src/com/bekvon/bukkit/residence/Residence.java +++ b/src/com/bekvon/bukkit/residence/Residence.java @@ -359,6 +359,7 @@ public class Residence extends JavaPlugin { } YMLSaveHelper yml; File loadFile; + long time = System.currentTimeMillis(); HashMap worlds = new HashMap(); for (World world : server.getWorlds()) { loadFile = new File(worldFolder, "res_" + world.getName() + ".yml"); @@ -397,10 +398,13 @@ public class Residence extends JavaPlugin { rentmanager = RentManager.load((Map) yml.getRoot() .get("RentSystem")); } + this.getLogger().info( + "从配置文件中读取领地数据,耗时" + ((float) (System.currentTimeMillis() - time) / 1000) + + " 秒)"); // System.out.print("[Residence] Loaded..."); return true; } catch (Exception ex) { - this.getLogger().warning("领地数据载入时发生错误,请报告一下内容给作者: "); + this.getLogger().warning("领地数据载入时发生错误,请报告以下内容给作者: "); this.getLogger().warning("错误: " + ex); throw ex; } @@ -618,6 +622,7 @@ public class Residence extends JavaPlugin { File worldFolder = new File(saveFolder, "Worlds"); worldFolder.mkdirs(); YMLSaveHelper yml; + long time = System.currentTimeMillis(); Map save = rmanager.save(); for (Entry entry : save.entrySet()) { File ymlSaveLoc = new File(worldFolder, "res_" + entry.getKey() + ".yml"); @@ -714,7 +719,8 @@ public class Residence extends JavaPlugin { ymlSaveLoc.renameTo(backupFile); } tmpFile.renameTo(ymlSaveLoc); - + this.getLogger().info( + "保存领地数据到文件中,耗时" + ((float) (System.currentTimeMillis() - time) / 1000) + " 秒)"); if (cmanager.showIntervalMessages()) { this.getLogger().info(" - 保存插件数据..."); }