From 388512c820ddd0ed6225bc680a080df79f3472cf Mon Sep 17 00:00:00 2001 From: Zrips Date: Fri, 23 Sep 2016 16:05:31 +0300 Subject: [PATCH] Load players information from database if multyserver support turned on --- com/gamingmesh/jobs/PlayerManager.java | 7 ++----- .../jobs/config/LanguageManager.java | 20 +++++++++---------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/com/gamingmesh/jobs/PlayerManager.java b/com/gamingmesh/jobs/PlayerManager.java index 0aed1fe0..1e792347 100644 --- a/com/gamingmesh/jobs/PlayerManager.java +++ b/com/gamingmesh/jobs/PlayerManager.java @@ -117,14 +117,11 @@ public class PlayerManager { */ public void playerJoin(Player player) { JobsPlayer jPlayer = this.playersCache.get(player.getName().toLowerCase()); - if (jPlayer == null) { - Debug.D("not in cache"); + if (jPlayer == null || Jobs.getGCManager().MultiServerCompatability()) { jPlayer = Jobs.getJobsDAO().loadFromDao(player); jPlayer.loadLogFromDao(); this.playersCache.put(player.getName().toLowerCase(), jPlayer); - } else - - Debug.D("in cache"); + } this.players.put(player.getName().toLowerCase(), jPlayer); jPlayer.setPlayer(player); diff --git a/com/gamingmesh/jobs/config/LanguageManager.java b/com/gamingmesh/jobs/config/LanguageManager.java index fc27ab39..f0172d05 100644 --- a/com/gamingmesh/jobs/config/LanguageManager.java +++ b/com/gamingmesh/jobs/config/LanguageManager.java @@ -428,16 +428,16 @@ public class LanguageManager { c.get("signs.SpecialList.3.4", "&b************"); c.get("signs.cantcreate", "&4You can't create this sign!"); c.get("signs.cantdestroy", "&4You can't destroy this sign!"); - c.get("signs.topline", "&2[Jobs]"); - c.get("signs.secondline.join", "&2Join"); - c.get("signs.secondline.leave", "&4Leave"); - c.get("signs.secondline.toggle", "&2Toggle"); - c.get("signs.secondline.top", "&2Top"); - c.get("signs.secondline.browse", "&2Browse"); - c.get("signs.secondline.stats", "&2Stats"); - c.get("signs.secondline.limit", "&2Limit"); - c.get("signs.secondline.info", "&2Info"); - c.get("signs.secondline.archive", "&2Archive"); + c.get("signs.topline", "&0[Jobs]"); + c.get("signs.secondline.join", "&0Join"); + c.get("signs.secondline.leave", "&0Leave"); + c.get("signs.secondline.toggle", "&0Toggle"); + c.get("signs.secondline.top", "&0Top"); + c.get("signs.secondline.browse", "&0Browse"); + c.get("signs.secondline.stats", "&0Stats"); + c.get("signs.secondline.limit", "&0Limit"); + c.get("signs.secondline.info", "&0Info"); + c.get("signs.secondline.archive", "&0Archive"); //c.get("scoreboard.clear", "&eIf you want to remove scoreboard, type &2/jobs top clear"); c.get("scoreboard.topline", "&2Top &e%jobname%");