forked from MagicBane/Server
hard set mine windows
This commit is contained in:
@@ -212,19 +212,6 @@ public class Mine extends AbstractGameObject {
|
|||||||
for (Mine mine : serverMines) {
|
for (Mine mine : serverMines) {
|
||||||
Mine.mineMap.put(mine, mine.buildingID);
|
Mine.mineMap.put(mine, mine.buildingID);
|
||||||
Mine.towerMap.put(mine.buildingID, mine);
|
Mine.towerMap.put(mine.buildingID, mine);
|
||||||
if(mine.capSize == 5){
|
|
||||||
mine.liveLength = 1800;
|
|
||||||
}
|
|
||||||
if(mine.capSize == 10){
|
|
||||||
if(ThreadLocalRandom.current().nextInt(0,100) > 50){
|
|
||||||
mine.liveLength = 1800;
|
|
||||||
} else{
|
|
||||||
mine.liveLength = 3600;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(mine.capSize == 20){
|
|
||||||
mine.liveLength = 3600;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ChinaMines.add(serverMines.get(0));
|
ChinaMines.add(serverMines.get(0));
|
||||||
@@ -293,7 +280,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
writer.putInt(mine.production.hash);
|
writer.putInt(mine.production.hash);
|
||||||
writer.putInt(mine.getModifiedProductionAmount());
|
writer.putInt(mine.getModifiedProductionAmount());
|
||||||
writer.putInt(mine.getModifiedProductionAmount()); //TODO calculate range penalty here
|
writer.putInt(mine.getModifiedProductionAmount()); //TODO calculate range penalty here
|
||||||
writer.putInt(mine.liveLength); //window in seconds
|
writer.putInt(3600); //window in seconds
|
||||||
|
|
||||||
// Errant mines are currently open. Set time to now.
|
// Errant mines are currently open. Set time to now.
|
||||||
|
|
||||||
@@ -314,11 +301,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(0).withSecond(0).withNano(0);
|
mineOpenTime = LocalDateTime.now().withHour(mine.liveTime).withMinute(0).withSecond(0).withNano(0);
|
||||||
|
|
||||||
writer.putLocalDateTime(mineOpenTime);
|
writer.putLocalDateTime(mineOpenTime);
|
||||||
if(mine.liveLength == 3600) {
|
writer.putLocalDateTime(mineOpenTime.plusHours(1));
|
||||||
writer.putLocalDateTime(mineOpenTime.plusHours(1));
|
|
||||||
} else{
|
|
||||||
writer.putLocalDateTime(mineOpenTime.plusMinutes(30));
|
|
||||||
}
|
|
||||||
writer.put(mine.isActive ? (byte) 0x01 : (byte) 0x00);
|
writer.put(mine.isActive ? (byte) 0x01 : (byte) 0x00);
|
||||||
|
|
||||||
Building mineTower = BuildingManager.getBuilding(mine.buildingID);
|
Building mineTower = BuildingManager.getBuilding(mine.buildingID);
|
||||||
|
|||||||
Reference in New Issue
Block a user