forked from MagicBane/Server
Cleanup of logic.
This commit is contained in:
@@ -7,9 +7,6 @@
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
@@ -29,19 +26,18 @@ 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;
|
||||
|
||||
import java.net.UnknownHostException;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import static engine.gameManager.DbManager.*;
|
||||
import static engine.gameManager.DbManager.MineQueries;
|
||||
import static engine.gameManager.DbManager.getObject;
|
||||
import static engine.math.FastMath.sqr;
|
||||
|
||||
public class Mine extends AbstractGameObject {
|
||||
@@ -64,9 +60,6 @@ public class Mine extends AbstractGameObject {
|
||||
//flags 1: never been claimed (make active).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Not persisted to DB
|
||||
private String guildName;
|
||||
private GuildTag guildTag;
|
||||
@@ -481,11 +474,19 @@ try{
|
||||
//never knocked down, let's just move on.
|
||||
//hasn't been claimed since server start.
|
||||
this.setActive(false);
|
||||
this.lastClaimerSessionID = null;
|
||||
this.lastClaimer = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!validClaimer(this.lastClaimer))
|
||||
// This mine does not have a valid claimer
|
||||
// we will therefore set it to errant
|
||||
|
||||
if (!validClaimer(this.lastClaimer)) {
|
||||
this.lastClaimerSessionID = null;
|
||||
this.lastClaimer = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.owningGuild == null || this.owningGuild.isErrant() || this.owningGuild.getNation().isErrant())
|
||||
return false;
|
||||
@@ -500,14 +501,6 @@ try{
|
||||
|
||||
setLastChange(System.currentTimeMillis());
|
||||
|
||||
if (mineBuilding.getRank() < 1){
|
||||
|
||||
if (this.lastClaimer == null){
|
||||
this.lastClaimerSessionID = null;
|
||||
updateGuildOwner(null);
|
||||
return false;
|
||||
}
|
||||
|
||||
mineBuilding.rebuildMine();
|
||||
WorldGrid.updateObject(mineBuilding);
|
||||
ChatManager.chatSystemChannel(this.lastClaimer.getName() + " has claimed the mine in " + this.parentZone.getParent().getName() + " for " + this.owningGuild.getName() + ". The mine is no longer active.");
|
||||
@@ -517,10 +510,7 @@ try{
|
||||
MineRecord mineRecord = MineRecord.borrow(this, this.lastClaimer, Enum.RecordEventType.CAPTURE);
|
||||
DataWarehouse.pushToWarehouse(mineRecord);
|
||||
|
||||
}else{
|
||||
mineBuilding.setRank(mineBuilding.getRank());
|
||||
}
|
||||
|
||||
this.setActive(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user