Complete JodaTime -> java.time migration (remaining objects, db handlers, net msg, jobs) + QC pass; untrack working reference files

This commit is contained in:
SlaveOfMagicbot committed 2026-10-05 23:01:19 -05:00
1 parent efd35e89f1
commit 93eb77fcc8
26 files changed
+160 -426

No files matched your search

+10 -11
View File
@@ -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());
+3 -3
View File
@@ -14,7 +14,7 @@ import engine.objects.Bane;
import engine.objects.Building;
import engine.objects.City;
import engine.objects.PlayerCharacter;
import java.time.Instant;
import java.time.LocalDateTime;
import org.pmw.tinylog.Logger;
import java.sql.Connection;
@@ -71,12 +71,12 @@ public class dbBaneHandler extends dbHandlerBase {
}
public boolean SET_BANE_TIME(Instant toSet, int cityUUID) {
public boolean SET_BANE_TIME(LocalDateTime toSet, int cityUUID) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_banes` SET `liveDate`=? WHERE `cityUUID`=?")) {
preparedStatement.setTimestamp(1, java.sql.Timestamp.from(toSet));
preparedStatement.setTimestamp(1, java.sql.Timestamp.valueOf(toSet));
preparedStatement.setLong(2, cityUUID);
preparedStatement.execute();
+2 -2
View File
@@ -308,7 +308,7 @@ public class dbNPCHandler extends dbHandlerBase {
+ NPC._pirateNames.size() + " mobBases");
}
public boolean ADD_TO_PRODUCTION_LIST(final long ID, final long npcUID, final long itemBaseID, Instant dateTime, String prefix, String suffix, String name, boolean isRandom, int playerID) {
public boolean ADD_TO_PRODUCTION_LIST(final long ID, final long npcUID, final long itemBaseID, long dateTime, String prefix, String suffix, String name, boolean isRandom, int playerID) {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_npc_production` (`ID`,`npcUID`, `itemBaseID`,`dateToUpgrade`, `isRandom`, `prefix`, `suffix`, `name`,`playerID`) VALUES (?,?,?,?,?,?,?,?,?)")) {
@@ -316,7 +316,7 @@ public class dbNPCHandler extends dbHandlerBase {
preparedStatement.setLong(1, ID);
preparedStatement.setLong(2, npcUID);
preparedStatement.setLong(3, itemBaseID);
preparedStatement.setTimestamp(4, java.sql.Timestamp.from(dateTime));
preparedStatement.setTimestamp(4, new java.sql.Timestamp(dateTime));
preparedStatement.setBoolean(5, isRandom);
preparedStatement.setString(6, prefix);
preparedStatement.setString(7, suffix);