Skip to content

Commit cde7c16

Browse files
committed
fix(converter): NexAuth joined/last_seen not a real timestamp
1 parent f7cf25c commit cde7c16

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

authme-core/src/main/java/fr/xephi/authme/datasource/converter/NexAuthConverter.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.sql.PreparedStatement;
2020
import java.sql.ResultSet;
2121
import java.sql.SQLException;
22-
import java.sql.Timestamp;
2322
import java.util.Base64;
2423
import java.util.Locale;
2524
import java.util.regex.Matcher;
@@ -114,17 +113,17 @@ private static void importRows(ResultSet rs, DataSource dataSource, CommandSende
114113
continue;
115114
}
116115

117-
Timestamp joined = rs.getTimestamp("joined");
118-
Timestamp lastSeen = rs.getTimestamp("last_seen");
116+
long joined = rs.getLong("joined");
117+
long lastSeen = rs.getLong("last_seen");
119118

120119
PlayerAuth auth = PlayerAuth.builder()
121120
.name(name)
122121
.realName(realName)
123122
.password(password)
124123
.lastIp(rs.getString("ip"))
125124
.email(rs.getString("email"))
126-
.registrationDate(joined != null ? joined.getTime() : 0L)
127-
.lastLogin(lastSeen != null ? lastSeen.getTime() : null)
125+
.registrationDate(joined > 0 ? joined : 0L)
126+
.lastLogin(lastSeen > 0 ? lastSeen : null)
128127
.totpKey(rs.getString("secret"))
129128
.uuid(UuidUtils.parseUuidSafely(rs.getString("uuid")))
130129
.premiumUuid(UuidUtils.parseUuidSafely(rs.getString("premium_uuid")))

0 commit comments

Comments
 (0)