From 26dcccad810920a191cb951b7c5cde7fd7ce4583 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 13 Jan 2023 11:24:41 -0500 Subject: [PATCH] Errant mines now change owner in database. --- src/engine/objects/Mine.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index f201d010..b54af98b 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -29,6 +29,7 @@ import engine.gameManager.*; import engine.net.ByteBufferWriter; import engine.net.client.msg.ErrorPopupMsg; import engine.server.MBServerStatics; +import engine.server.world.WorldServer; import engine.session.SessionID; import org.pmw.tinylog.Logger; @@ -40,8 +41,7 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.concurrent.ConcurrentHashMap; -import static engine.gameManager.DbManager.MineQueries; -import static engine.gameManager.DbManager.getObject; +import static engine.gameManager.DbManager.*; import static engine.math.FastMath.sqr; public class Mine extends AbstractGameObject { @@ -511,6 +511,10 @@ try{ this.owningGuild = null; Mine.setLastChange(System.currentTimeMillis()); + // Update database + + DbManager.MineQueries.CHANGE_OWNER(this, 0); + // remove hirelings Building building = (Building) getObject(Enum.GameObjectType.Building, this.buildingID);