Fixed a register bug introduced in commit 7af6cd2

This commit is contained in:
Rsl1122 2017-10-08 11:49:06 +03:00
parent 2b4553e5e3
commit c49ae0048f
2 changed files with 4 additions and 2 deletions

View File

@ -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);

View File

@ -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();
}