|
|
@ -236,7 +236,7 @@ public enum InterestManager implements Runnable { |
|
|
|
|
|
|
|
|
|
|
|
if (distanceSquared > sqr(25)) |
|
|
|
if (distanceSquared > sqr(25)) |
|
|
|
player.setLastStaticLoc(player.getLoc()); |
|
|
|
player.setLastStaticLoc(player.getLoc()); |
|
|
|
else if (player.dirtyLoad.get() == false) |
|
|
|
else if (player.isDirtyLoad() == false) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
// Get Statics in range
|
|
|
|
// Get Statics in range
|
|
|
@ -314,7 +314,7 @@ public enum InterestManager implements Runnable { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
loadedStaticObjects.addAll(toLoad); |
|
|
|
loadedStaticObjects.addAll(toLoad); |
|
|
|
player.dirtyLoad.set(false); |
|
|
|
player.setDirtyLoad(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void updateMobileList(PlayerCharacter player, ClientConnection origin) { |
|
|
|
private void updateMobileList(PlayerCharacter player, ClientConnection origin) { |
|
|
@ -519,22 +519,12 @@ public enum InterestManager implements Runnable { |
|
|
|
if (origin == null) |
|
|
|
if (origin == null) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
//Update static list
|
|
|
|
// Update loaded upbjects lists
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
player.setDirtyLoad(true); |
|
|
|
player.dirtyLoad.set(true); |
|
|
|
|
|
|
|
updateStaticList(player, origin); |
|
|
|
updateStaticList(player, origin); |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
Logger.error("InterestManager.updateAllStaticPlayers: " + player.getObjectUUID(), e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Update mobile list
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
updateMobileList(player, origin); |
|
|
|
updateMobileList(player, origin); |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
Logger.error("InterestManager.updateAllMobilePlayers: " + player.getObjectUUID(), e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public synchronized void HandleLoadForTeleport(PlayerCharacter playerCharacter) { |
|
|
|
public synchronized void HandleLoadForTeleport(PlayerCharacter playerCharacter) { |
|
|
@ -547,22 +537,12 @@ public enum InterestManager implements Runnable { |
|
|
|
if (origin == null) |
|
|
|
if (origin == null) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
//Update static list
|
|
|
|
// Update loaded upbjects lists
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
playerCharacter.setDirtyLoad(true); |
|
|
|
playerCharacter.dirtyLoad.set(true); |
|
|
|
|
|
|
|
updateStaticList(playerCharacter, origin); |
|
|
|
updateStaticList(playerCharacter, origin); |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
Logger.error("InterestManager.updateAllStaticPlayers: " + playerCharacter.getObjectUUID(), e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Update mobile list
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
updateMobileList(playerCharacter, origin); |
|
|
|
updateMobileList(playerCharacter, origin); |
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
Logger.error("InterestManager.updateAllMobilePlayers: " + playerCharacter.getObjectUUID(), e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void setObjectDirty(AbstractWorldObject abstractWorldObject) { |
|
|
|
public static void setObjectDirty(AbstractWorldObject abstractWorldObject) { |
|
|
@ -575,7 +555,7 @@ public enum InterestManager implements Runnable { |
|
|
|
for (AbstractWorldObject playerObject : playerList) { |
|
|
|
for (AbstractWorldObject playerObject : playerList) { |
|
|
|
|
|
|
|
|
|
|
|
PlayerCharacter playerCharacter = (PlayerCharacter) playerObject; |
|
|
|
PlayerCharacter playerCharacter = (PlayerCharacter) playerObject; |
|
|
|
playerCharacter.dirtyLoad.set(true); |
|
|
|
playerCharacter.setDirtyLoad(true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |