From 87587d3852ffd4b69bde381214b2b657ca4f1662 Mon Sep 17 00:00:00 2001 From: Zrips Date: Fri, 11 Mar 2022 17:11:49 +0200 Subject: [PATCH] Defaulting to save on disconnect with multiserver support --- src/main/java/com/gamingmesh/jobs/PlayerManager.java | 2 +- src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java | 1 - src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/PlayerManager.java b/src/main/java/com/gamingmesh/jobs/PlayerManager.java index 26b7602a..a5e70ba2 100644 --- a/src/main/java/com/gamingmesh/jobs/PlayerManager.java +++ b/src/main/java/com/gamingmesh/jobs/PlayerManager.java @@ -278,7 +278,7 @@ public class PlayerManager { return; jPlayer.onDisconnect(); - if (Jobs.getGCManager().saveOnDisconnect()) { + if (Jobs.getGCManager().saveOnDisconnect() || Jobs.getGCManager().MultiServerCompatability()) { jPlayer.setSaved(false); jPlayer.save(); } diff --git a/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java b/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java index 9b2f505f..02e2ebb1 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobsPlayer.java @@ -890,7 +890,6 @@ public class JobsPlayer { * Perform disconnect for this player */ public void onDisconnect() { -// Jobs.getJobsDAO().savePoints(this); clearBossMaps(); isOnline = false; Jobs.getPlayerManager().addPlayerToCache(this); diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java index 34635ab7..d7e9410f 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsListener.java @@ -166,7 +166,7 @@ public class JobsListener implements Listener { if (!Jobs.getGCManager().MultiServerCompatability()) Jobs.getPlayerManager().playerJoin(event.getPlayer()); else { - plugin.getServer().getScheduler().runTaskLater(plugin, () -> Jobs.getPlayerManager().playerJoin(event.getPlayer()), 10L); + plugin.getServer().getScheduler().runTaskLater(plugin, () -> Jobs.getPlayerManager().playerJoin(event.getPlayer()), 40L); } }