From c49ae0048fe3be7c3791828393b0ba74ec336a4e Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Sun, 8 Oct 2017 11:49:06 +0300 Subject: [PATCH] Fixed a register bug introduced in commit 7af6cd2 --- .../plan/systems/processing/player/RegisterProcessor.java | 4 ++-- .../main/java/com/djrapitops/plan/database/DatabaseTest.java | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/processing/player/RegisterProcessor.java b/Plan/src/main/java/com/djrapitops/plan/systems/processing/player/RegisterProcessor.java index f09f9dba3..bad49c9e3 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/processing/player/RegisterProcessor.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/processing/player/RegisterProcessor.java @@ -52,10 +52,10 @@ public class RegisterProcessor extends PlayerProcessor { if (db.getActionsTable().getActions(uuid).size() > 0) { return; } - plugin.getDataCache().markFirstSession(uuid); - if (userInfoTable.isRegistered(uuid)) { + if (!userInfoTable.isRegistered(uuid)) { userInfoTable.registerUserInfo(uuid, registered); } + plugin.getDataCache().markFirstSession(uuid); db.getActionsTable().insertAction(uuid, new Action(time, Actions.FIRST_SESSION, "Online: " + playersOnline + " Players")); } catch (SQLException e) { Log.toLog(this.getClass().getName(), e); diff --git a/Plan/test/main/java/com/djrapitops/plan/database/DatabaseTest.java b/Plan/test/main/java/com/djrapitops/plan/database/DatabaseTest.java index be14a4597..539b69365 100644 --- a/Plan/test/main/java/com/djrapitops/plan/database/DatabaseTest.java +++ b/Plan/test/main/java/com/djrapitops/plan/database/DatabaseTest.java @@ -863,6 +863,8 @@ public class DatabaseTest { @Test public void testRegisterProcessorRegisterException() throws SQLException { + assertFalse(db.getUsersTable().isRegistered(uuid)); + assertFalse(db.getUserInfoTable().isRegistered(uuid)); for (int i = 0; i < 200; i++) { new RegisterProcessor(uuid, 500L, 1000L, "name", 4).process(); }