Browse Source

zerg mechanic work

lakebane-master
FatBoy-DOTC 8 months ago
parent
commit
8a3a4645af
  1. 7
      src/engine/jobs/ActivateBaneJob.java
  2. 5
      src/engine/objects/Mine.java
  3. 15
      src/engine/workthreads/ZergMechanicThread.java

7
src/engine/jobs/ActivateBaneJob.java

@ -15,10 +15,13 @@ import engine.gameManager.DbManager;
import engine.job.AbstractScheduleJob; import engine.job.AbstractScheduleJob;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.msg.chat.ChatSystemMsg; import engine.net.client.msg.chat.ChatSystemMsg;
import engine.objects.Bane;
import engine.objects.City; import engine.objects.City;
import engine.workthreads.ZergMechanicThread; import engine.workthreads.ZergMechanicThread;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import static engine.workthreads.ZergMechanicThread.startZergThreadBane;
public class ActivateBaneJob extends AbstractScheduleJob { public class ActivateBaneJob extends AbstractScheduleJob {
private final int cityUUID; private final int cityUUID;
@ -70,9 +73,7 @@ public class ActivateBaneJob extends AbstractScheduleJob {
DispatchMessage.dispatchMsgToAll(msg); DispatchMessage.dispatchMsgToAll(msg);
if(city.getBane() != null) { if(city.getBane() != null) {
Thread zergMechanicThread = new Thread(new ZergMechanicThread(city.getBane(), null)); startZergThreadBane(city.getBane());
zergMechanicThread.setName(city.getName() + "Bane");
zergMechanicThread.start();
} }
} }

5
src/engine/objects/Mine.java

@ -581,10 +581,7 @@ public class Mine extends AbstractGameObject {
building.isDeranking.compareAndSet(true, false); building.isDeranking.compareAndSet(true, false);
if(isAc) { if(isAc) {
Thread zergMechanicThread; ZergMechanicThread.startZergThreadMine(this);
zergMechanicThread = new Thread(new ZergMechanicThread(null, this));
zergMechanicThread.setName(this.parentZone.getName() + "Mine");
zergMechanicThread.start();
} }
} }

15
src/engine/workthreads/ZergMechanicThread.java

@ -14,6 +14,7 @@ import engine.InterestManagement.WorldGrid;
import engine.db.archive.DataWarehouse; import engine.db.archive.DataWarehouse;
import engine.db.archive.MineRecord; import engine.db.archive.MineRecord;
import engine.gameManager.*; import engine.gameManager.*;
import engine.mobileAI.Threads.MobAIThread;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.MessageDispatcher; import engine.net.MessageDispatcher;
import engine.net.client.msg.chat.ChatSystemMsg; import engine.net.client.msg.chat.ChatSystemMsg;
@ -163,4 +164,18 @@ public Mine mine = null;
} }
} }
} }
public static void startZergThreadMine(Mine mine) {
Thread zergMechanicThread;
zergMechanicThread = new Thread(new ZergMechanicThread(null, mine));
zergMechanicThread.setName(mine.getParentZone().getName() + "Mine");
zergMechanicThread.start();
}
public static void startZergThreadBane(Bane bane) {
Thread zergMechanicThread;
zergMechanicThread = new Thread(new ZergMechanicThread(bane, null));
zergMechanicThread.setName(bane.getCity().getGuild().getName() + "Bane");
zergMechanicThread.start();
}
} }

Loading…
Cancel
Save