Complete JodaTime -> java.time migration (remaining objects, db handlers, net msg, jobs) + QC pass; untrack working reference files
This commit is contained in:
1 parent
efd35e89f1
commit
93eb77fcc8
26 files changed
+160
-426
No files matched your search
@@ -14,7 +14,6 @@ import engine.gameManager.DbManager;
|
||||
import engine.objects.Bane;
|
||||
import engine.objects.City;
|
||||
import engine.workthreads.WarehousePushThread;
|
||||
import java.time.Instant;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.*;
|
||||
@@ -34,8 +33,8 @@ public class BaneRecord extends DataRecord {
|
||||
private String baneDropperHash;
|
||||
private String baneGuildHash;
|
||||
private String baneNationHash;
|
||||
private Instant baneLiveTime;
|
||||
private Instant baneDropTime;
|
||||
private LocalDateTime baneLiveTime;
|
||||
private LocalDateTime baneDropTime;
|
||||
|
||||
private BaneRecord(Bane bane) {
|
||||
this.recordType = Enum.DataRecordType.BANE;
|
||||
@@ -129,9 +128,9 @@ public class BaneRecord extends DataRecord {
|
||||
return outStatement;
|
||||
}
|
||||
|
||||
public static Instant getLastBaneDateTime(City city) {
|
||||
public static LocalDateTime getLastBaneDateTime(City city) {
|
||||
|
||||
Instant outDateTime = null;
|
||||
LocalDateTime outDateTime = null;
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement statement = buildDateTimeQueryStatement(connection, city);
|
||||
@@ -139,7 +138,7 @@ public class BaneRecord extends DataRecord {
|
||||
|
||||
while (rs.next()) {
|
||||
|
||||
outDateTime = rs.getTimestamp("endDatetime").toInstant();
|
||||
outDateTime = rs.getTimestamp("endDatetime").toLocalDateTime();
|
||||
|
||||
}
|
||||
|
||||
@@ -160,7 +159,7 @@ public class BaneRecord extends DataRecord {
|
||||
|
||||
}
|
||||
|
||||
public static void updateLiveDate(Bane bane, Instant dateTime) {
|
||||
public static void updateLiveDate(Bane bane, LocalDateTime dateTime) {
|
||||
|
||||
if (bane == null)
|
||||
return;
|
||||
@@ -175,13 +174,13 @@ public class BaneRecord extends DataRecord {
|
||||
}
|
||||
}
|
||||
|
||||
private static PreparedStatement buildUpdateLiveDateStatement(Connection connection, Bane bane, Instant dateTime) throws SQLException {
|
||||
private static PreparedStatement buildUpdateLiveDateStatement(Connection connection, Bane bane, LocalDateTime dateTime) throws SQLException {
|
||||
|
||||
PreparedStatement outStatement = null;
|
||||
String queryString = "UPDATE `warehouse_banehistory` SET `liveDatetime` = ?, `dirty` = 1 WHERE `city_id` = ? AND `resolution` = 'PENDING'";
|
||||
|
||||
outStatement = connection.prepareStatement(queryString);
|
||||
outStatement.setTimestamp(1, new java.sql.Timestamp(dateTime.toEpochMilli()));
|
||||
outStatement.setTimestamp(1, Timestamp.valueOf(dateTime));
|
||||
outStatement.setString(2, bane.getCity().getHash());
|
||||
|
||||
return outStatement;
|
||||
@@ -366,12 +365,12 @@ public class BaneRecord extends DataRecord {
|
||||
if (this.baneDropTime == null)
|
||||
outStatement.setNull(8, java.sql.Types.DATE);
|
||||
else
|
||||
outStatement.setTimestamp(8, new java.sql.Timestamp(this.baneDropTime.getMillis()));
|
||||
outStatement.setTimestamp(8, Timestamp.valueOf(this.baneDropTime));
|
||||
|
||||
if (this.baneLiveTime == null)
|
||||
outStatement.setNull(9, java.sql.Types.DATE);
|
||||
else
|
||||
outStatement.setTimestamp(9, new java.sql.Timestamp(this.baneLiveTime.getMillis()));
|
||||
outStatement.setTimestamp(9, Timestamp.valueOf(this.baneLiveTime));
|
||||
|
||||
outStatement.setString(10, this.eventType.name());
|
||||
|
||||
|
||||
Reference in new issue
Block a user