Browse Source

dirtyFlag integration.

master
MagicBot 1 year ago
parent
commit
f6e2c6c618
  1. 32
      src/engine/InterestManagement/InterestManager.java

32
src/engine/InterestManagement/InterestManager.java

@ -200,28 +200,28 @@ public enum InterestManager implements Runnable {
private void updateAllPlayers() { private void updateAllPlayers() {
// get all players // get all players
for (PlayerCharacter pc : SessionManager.getAllActivePlayerCharacters()) { for (PlayerCharacter playerCharacter : SessionManager.getAllActivePlayerCharacters()) {
if (pc == null) if (playerCharacter == null)
continue; continue;
ClientConnection origin = pc.getClientConnection(); ClientConnection origin = playerCharacter.getClientConnection();
if (origin == null) if (origin == null)
continue; continue;
if (!pc.isEnteredWorld()) if (!playerCharacter.isEnteredWorld())
continue; continue;
if (pc.getTeleportLock().readLock().tryLock()) { if (playerCharacter.getTeleportLock().readLock().tryLock()) {
try { try {
updateStaticList(pc, origin); updateStaticList(playerCharacter, origin);
updateMobileList(pc, origin); updateMobileList(playerCharacter, origin);
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);
} finally { } finally {
pc.getTeleportLock().readLock().unlock(); playerCharacter.getTeleportLock().readLock().unlock();
} }
} }
} }
@ -522,6 +522,7 @@ public enum InterestManager implements Runnable {
//Update static list //Update static list
try { try {
player.dirtyLoad = true;
updateStaticList(player, origin); updateStaticList(player, origin);
} catch (Exception e) { } catch (Exception e) {
Logger.error("InterestManager.updateAllStaticPlayers: " + player.getObjectUUID(), e); Logger.error("InterestManager.updateAllStaticPlayers: " + player.getObjectUUID(), e);
@ -536,12 +537,12 @@ public enum InterestManager implements Runnable {
} }
} }
public synchronized void HandleLoadForTeleport(PlayerCharacter player) { public synchronized void HandleLoadForTeleport(PlayerCharacter playerCharacter) {
if (player == null) if (playerCharacter == null)
return; return;
ClientConnection origin = player.getClientConnection(); ClientConnection origin = playerCharacter.getClientConnection();
if (origin == null) if (origin == null)
return; return;
@ -549,17 +550,18 @@ public enum InterestManager implements Runnable {
//Update static list //Update static list
try { try {
updateStaticList(player, origin); playerCharacter.dirtyLoad = true;
updateStaticList(playerCharacter, origin);
} catch (Exception e) { } catch (Exception e) {
Logger.error("InterestManager.updateAllStaticPlayers: " + player.getObjectUUID(), e); Logger.error("InterestManager.updateAllStaticPlayers: " + playerCharacter.getObjectUUID(), e);
} }
//Update mobile list //Update mobile list
try { try {
updateMobileList(player, origin); updateMobileList(playerCharacter, origin);
} catch (Exception e) { } catch (Exception e) {
Logger.error("InterestManager.updateAllMobilePlayers: " + player.getObjectUUID(), e); Logger.error("InterestManager.updateAllMobilePlayers: " + playerCharacter.getObjectUUID(), e);
} }
} }

Loading…
Cancel
Save