|
|
@ -15,11 +15,13 @@ import engine.gameManager.*; |
|
|
|
import engine.net.ByteBufferWriter; |
|
|
|
import engine.net.ByteBufferWriter; |
|
|
|
import engine.net.client.msg.ErrorPopupMsg; |
|
|
|
import engine.net.client.msg.ErrorPopupMsg; |
|
|
|
import engine.server.MBServerStatics; |
|
|
|
import engine.server.MBServerStatics; |
|
|
|
|
|
|
|
import org.joda.time.DateTime; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
|
|
|
import java.net.UnknownHostException; |
|
|
|
import java.net.UnknownHostException; |
|
|
|
import java.sql.ResultSet; |
|
|
|
import java.sql.ResultSet; |
|
|
|
import java.sql.SQLException; |
|
|
|
import java.sql.SQLException; |
|
|
|
|
|
|
|
import java.sql.Time; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
@ -57,6 +59,12 @@ public class Mine extends AbstractGameObject { |
|
|
|
public Integer totalPlayers; |
|
|
|
public Integer totalPlayers; |
|
|
|
|
|
|
|
|
|
|
|
public boolean hasProduced = false; |
|
|
|
public boolean hasProduced = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int liveTime; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static ArrayList<Mine> ChinaMines = new ArrayList<>(); |
|
|
|
|
|
|
|
public static ArrayList<Mine> EuroMines = new ArrayList<>(); |
|
|
|
|
|
|
|
public static ArrayList<Mine> AmericaMines = new ArrayList<>(); |
|
|
|
/** |
|
|
|
/** |
|
|
|
* ResultSet Constructor |
|
|
|
* ResultSet Constructor |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -110,9 +118,70 @@ public class Mine extends AbstractGameObject { |
|
|
|
Building mineTower = BuildingManager.getBuilding(this.buildingID); |
|
|
|
Building mineTower = BuildingManager.getBuilding(this.buildingID); |
|
|
|
mineTower.setMaxHitPoints(5000 * this.capSize); |
|
|
|
mineTower.setMaxHitPoints(5000 * this.capSize); |
|
|
|
mineTower.setCurrentHitPoints((float)5000 * this.capSize); |
|
|
|
mineTower.setCurrentHitPoints((float)5000 * this.capSize); |
|
|
|
|
|
|
|
setLiveTime(this); |
|
|
|
//add a comment
|
|
|
|
//add a comment
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void setLiveTime(Mine mine){ |
|
|
|
|
|
|
|
if(EuroMines.size() < 7){ |
|
|
|
|
|
|
|
EuroMines.add(mine); |
|
|
|
|
|
|
|
} else if(ChinaMines.size() < 14){ |
|
|
|
|
|
|
|
ChinaMines.add(mine); |
|
|
|
|
|
|
|
} else{ |
|
|
|
|
|
|
|
AmericaMines.add(mine); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(EuroMines.size() == 7){ |
|
|
|
|
|
|
|
SetEuroTimes(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(ChinaMines.size() == 14){ |
|
|
|
|
|
|
|
SetChinaTimes(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(AmericaMines.size() == 14){ |
|
|
|
|
|
|
|
SetAmericaTimes(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void SetEuroTimes(){ |
|
|
|
|
|
|
|
EuroMines.get(0).liveTime = 12; |
|
|
|
|
|
|
|
EuroMines.get(1).liveTime = 13; |
|
|
|
|
|
|
|
EuroMines.get(2).liveTime = 14; |
|
|
|
|
|
|
|
EuroMines.get(3).liveTime = 14; |
|
|
|
|
|
|
|
EuroMines.get(4).liveTime = 15; |
|
|
|
|
|
|
|
EuroMines.get(5).liveTime = 15; |
|
|
|
|
|
|
|
EuroMines.get(6).liveTime = 16; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public static void SetChinaTimes(){ |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 4; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 5; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 6; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 6; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 7; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 7; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 8; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 8; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 9; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 9; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 10; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 10; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 11; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 12; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public static void SetAmericaTimes(){ |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 14; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 15; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 16; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 16; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 17; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 17; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 18; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 18; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 19; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 19; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 20; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 20; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 21; |
|
|
|
|
|
|
|
ChinaMines.get(0).liveTime = 22; |
|
|
|
|
|
|
|
} |
|
|
|
public static void releaseMineClaims(PlayerCharacter playerCharacter) { |
|
|
|
public static void releaseMineClaims(PlayerCharacter playerCharacter) { |
|
|
|
|
|
|
|
|
|
|
|
if (playerCharacter == null) |
|
|
|
if (playerCharacter == null) |
|
|
@ -206,7 +275,7 @@ public class Mine extends AbstractGameObject { |
|
|
|
|
|
|
|
|
|
|
|
if (mineNatonGuild.isEmptyGuild() == false && mine.isActive == false) { |
|
|
|
if (mineNatonGuild.isEmptyGuild() == false && mine.isActive == false) { |
|
|
|
|
|
|
|
|
|
|
|
int guildWOO = mineNatonGuild.getNation().getMineTime(); |
|
|
|
int guildWOO = mine.liveTime;//mineNatonGuild.getNation().getMineTime();
|
|
|
|
LocalDateTime guildMineTime = mineOpenTime.withHour(guildWOO); |
|
|
|
LocalDateTime guildMineTime = mineOpenTime.withHour(guildWOO); |
|
|
|
|
|
|
|
|
|
|
|
if (mineOpenTime.isAfter(guildMineTime) || mine.wasClaimed == true) |
|
|
|
if (mineOpenTime.isAfter(guildMineTime) || mine.wasClaimed == true) |
|
|
|