From 8e61bf2d283fd03cf96e2cfe16afcb556ff5362b Mon Sep 17 00:00:00 2001 From: Zrips Date: Mon, 13 Sep 2021 14:45:40 +0300 Subject: [PATCH] Fail safe for duplicated user entries --- src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java index 124a4dc8..c1a63aa6 100644 --- a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java +++ b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java @@ -897,6 +897,14 @@ public abstract class JobsDAO { JobsConnection conn = getConnection(); if (conn == null) return; + + // Checking possible record in database to avoid duplicates + PlayerInfo info = loadPlayerData(uuid); + if (info != null) { + Jobs.getPlayerManager().addPlayerToMap(info); + return; + } + PreparedStatement prestt = null; ResultSet res2 = null; try {