forked from MagicBane/Server
fix: resolve jodatime->java.time build errors (ZoneId imports, Timestamp/Instant conversions, plus arg order)
This commit is contained in:
@@ -842,7 +842,7 @@ public class dbBuildingHandler extends dbHandlerBase {
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE obj_building SET taxDate=? "
|
||||
+ "WHERE UID = ?")) {
|
||||
|
||||
preparedStatement.setTimestamp(1, new java.sql.Timestamp(Instant.now().plus(java.time.temporal.ChronoUnit.DAYS, 7).toEpochMilli()));
|
||||
preparedStatement.setTimestamp(1, new java.sql.Timestamp(Instant.now().plus(7, java.time.temporal.ChronoUnit.DAYS).toEpochMilli()));
|
||||
preparedStatement.setInt(2, building.getObjectUUID());
|
||||
|
||||
return (preparedStatement.executeUpdate() > 0);
|
||||
|
||||
@@ -278,7 +278,7 @@ public enum BuildingManager {
|
||||
|
||||
if (building == null)
|
||||
return;
|
||||
if (!DbManager.BuildingQueries.updateBuildingUpgradeTime(upgradeDateTime, building, rankCost)) {
|
||||
if (!DbManager.BuildingQueries.updateBuildingUpgradeTime(upgradeDateTime.atZone(ZoneId.systemDefault()).toInstant(), building, rankCost)) {
|
||||
Logger.error("Failed to set upgradeTime for building " + building.getObjectUUID());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import engine.math.Vector3f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.util.ByteBufferUtils;
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -58,7 +58,7 @@ public final class Bane {
|
||||
*/
|
||||
public Bane(ResultSet rs) throws SQLException {
|
||||
|
||||
Date sqlDateTime;
|
||||
java.sql.Timestamp sqlDateTime;
|
||||
ActivateBaneJob abtj;
|
||||
|
||||
this.cityUUID = rs.getInt("cityUUID");
|
||||
|
||||
@@ -42,6 +42,7 @@ import engine.server.login.LoginServerMsgHandler;
|
||||
import engine.server.world.WorldServer;
|
||||
import engine.util.MiscUtils;
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
@@ -718,7 +719,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
writer.putInt(token);
|
||||
writer.putInt((int) timeLeft / 1000);
|
||||
}
|
||||
Instant enterWorld = playerCharacter.timestamps.get("EnterWorld").toInstant();
|
||||
Instant enterWorld = Instant.ofEpochMilli(playerCharacter.timestamps.get("EnterWorld"));
|
||||
writer.putDateTime(enterWorld);
|
||||
|
||||
writer.putInt(0x49EF1E98); //DUnno what playerCharacter is.
|
||||
|
||||
Reference in New Issue
Block a user