Header added
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2022
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
package engine.mobileAI.Threads;
|
package engine.mobileAI.Threads;
|
||||||
|
|
||||||
import engine.gameManager.ConfigManager;
|
import engine.gameManager.ConfigManager;
|
||||||
@@ -13,9 +21,11 @@ public class MobAIThread implements Runnable{
|
|||||||
public static int AI_PULSE_MOB_THRESHOLD = 200;
|
public static int AI_PULSE_MOB_THRESHOLD = 200;
|
||||||
public static int AI_PATROL_DIVISOR = 15;
|
public static int AI_PATROL_DIVISOR = 15;
|
||||||
public static float AI_CAST_FREQUENCY;
|
public static float AI_CAST_FREQUENCY;
|
||||||
|
|
||||||
// Thread constructor
|
// Thread constructor
|
||||||
|
|
||||||
public MobAIThread() {
|
public MobAIThread() {
|
||||||
|
|
||||||
//cache config value for mobile casting delay
|
//cache config value for mobile casting delay
|
||||||
|
|
||||||
AI_CAST_FREQUENCY = Float.parseFloat(ConfigManager.MB_AI_CAST_FREQUENCY.getValue());
|
AI_CAST_FREQUENCY = Float.parseFloat(ConfigManager.MB_AI_CAST_FREQUENCY.getValue());
|
||||||
|
|||||||
@@ -6,23 +6,13 @@
|
|||||||
// Magicbane Emulator Project © 2013 - 2022
|
// Magicbane Emulator Project © 2013 - 2022
|
||||||
// www.magicbane.com
|
// www.magicbane.com
|
||||||
|
|
||||||
|
|
||||||
package engine.mobileAI.Threads;
|
package engine.mobileAI.Threads;
|
||||||
|
|
||||||
import engine.gameManager.ZoneManager;
|
import engine.gameManager.ZoneManager;
|
||||||
import engine.objects.Mob;
|
import engine.objects.Mob;
|
||||||
import engine.objects.Zone;
|
import engine.objects.Zone;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
/**
|
|
||||||
* Thread blocks until MagicBane dispatch messages are
|
|
||||||
* enqueued then processes them in FIFO order. The collection
|
|
||||||
* is thread safe.
|
|
||||||
* <p>
|
|
||||||
* Any large messages not time sensitive such as load object
|
|
||||||
* sent to more than a single individual should be spawned
|
|
||||||
* individually on a DispatchMessageThread.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class MobRespawnThread implements Runnable {
|
public class MobRespawnThread implements Runnable {
|
||||||
|
|
||||||
|
|
||||||
@@ -37,8 +27,7 @@ public class MobRespawnThread implements Runnable {
|
|||||||
while (true) {
|
while (true) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (Zone zone : ZoneManager.getAllZones()) {
|
for (Zone zone : ZoneManager.getAllZones())
|
||||||
|
|
||||||
if (zone.respawnQue.isEmpty() == false && zone.lastRespawn + 100 < System.currentTimeMillis()) {
|
if (zone.respawnQue.isEmpty() == false && zone.lastRespawn + 100 < System.currentTimeMillis()) {
|
||||||
|
|
||||||
Mob respawner = zone.respawnQue.iterator().next();
|
Mob respawner = zone.respawnQue.iterator().next();
|
||||||
@@ -50,7 +39,6 @@ public class MobRespawnThread implements Runnable {
|
|||||||
zone.respawnQue.remove(respawner);
|
zone.respawnQue.remove(respawner);
|
||||||
zone.lastRespawn = System.currentTimeMillis();
|
zone.lastRespawn = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error(e);
|
Logger.error(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user