|
|
@ -12,6 +12,7 @@ import engine.Enum; |
|
|
|
import engine.Enum.DispatchChannel; |
|
|
|
import engine.Enum.DispatchChannel; |
|
|
|
import engine.Enum.GameObjectType; |
|
|
|
import engine.Enum.GameObjectType; |
|
|
|
import engine.gameManager.GroupManager; |
|
|
|
import engine.gameManager.GroupManager; |
|
|
|
|
|
|
|
import engine.gameManager.PlayerManager; |
|
|
|
import engine.gameManager.SessionManager; |
|
|
|
import engine.gameManager.SessionManager; |
|
|
|
import engine.job.JobScheduler; |
|
|
|
import engine.job.JobScheduler; |
|
|
|
import engine.jobs.RefreshGroupJob; |
|
|
|
import engine.jobs.RefreshGroupJob; |
|
|
@ -233,7 +234,7 @@ public enum InterestManager implements Runnable { |
|
|
|
|
|
|
|
|
|
|
|
if (distanceSquared > sqr(64)) |
|
|
|
if (distanceSquared > sqr(64)) |
|
|
|
player.setLastStaticLoc(player.getLoc()); |
|
|
|
player.setLastStaticLoc(player.getLoc()); |
|
|
|
else if (player.isDirtyLoad() == false) |
|
|
|
else if (PlayerManager.isDirtyLoad(player) == false) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
// Get Statics in range
|
|
|
|
// Get Statics in range
|
|
|
@ -286,14 +287,14 @@ public enum InterestManager implements Runnable { |
|
|
|
lsm.addObject((Building) awo); |
|
|
|
lsm.addObject((Building) awo); |
|
|
|
else if (awo.getObjectType().equals(GameObjectType.Corpse)) { |
|
|
|
else if (awo.getObjectType().equals(GameObjectType.Corpse)) { |
|
|
|
Corpse corpse = (Corpse) awo; |
|
|
|
Corpse corpse = (Corpse) awo; |
|
|
|
lcm = new LoadCharacterMsg(corpse, PlayerCharacter.hideNonAscii()); |
|
|
|
lcm = new LoadCharacterMsg(corpse, PlayerManager.hideNonAscii()); |
|
|
|
|
|
|
|
|
|
|
|
Dispatch dispatch = Dispatch.borrow(player, lcm); |
|
|
|
Dispatch dispatch = Dispatch.borrow(player, lcm); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); |
|
|
|
|
|
|
|
|
|
|
|
} else if (awo.getObjectType().equals(GameObjectType.NPC)) { |
|
|
|
} else if (awo.getObjectType().equals(GameObjectType.NPC)) { |
|
|
|
NPC npc = (NPC) awo; |
|
|
|
NPC npc = (NPC) awo; |
|
|
|
lcm = new LoadCharacterMsg(npc, PlayerCharacter.hideNonAscii()); |
|
|
|
lcm = new LoadCharacterMsg(npc, PlayerManager.hideNonAscii()); |
|
|
|
|
|
|
|
|
|
|
|
lcmList.add(lcm); |
|
|
|
lcmList.add(lcm); |
|
|
|
} |
|
|
|
} |
|
|
@ -311,7 +312,7 @@ public enum InterestManager implements Runnable { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
loadedStaticObjects.addAll(toLoad); |
|
|
|
loadedStaticObjects.addAll(toLoad); |
|
|
|
player.setDirtyLoad(false); |
|
|
|
PlayerManager.setDirtyLoad(player, false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void updateMobileList(PlayerCharacter player, ClientConnection origin) { |
|
|
|
private void updateMobileList(PlayerCharacter player, ClientConnection origin) { |
|
|
@ -437,7 +438,7 @@ public enum InterestManager implements Runnable { |
|
|
|
if (player.getSeeInvis() < awopc.getHidden()) |
|
|
|
if (player.getSeeInvis() < awopc.getHidden()) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
lcm = new LoadCharacterMsg(awopc, PlayerCharacter.hideNonAscii()); |
|
|
|
lcm = new LoadCharacterMsg(awopc, PlayerManager.hideNonAscii()); |
|
|
|
players.add(awo); |
|
|
|
players.add(awo); |
|
|
|
|
|
|
|
|
|
|
|
// check if in a group with the person being loaded
|
|
|
|
// check if in a group with the person being loaded
|
|
|
@ -466,11 +467,11 @@ public enum InterestManager implements Runnable { |
|
|
|
|
|
|
|
|
|
|
|
awonpc.playerAgroMap.put(player.getObjectUUID(), false); |
|
|
|
awonpc.playerAgroMap.put(player.getObjectUUID(), false); |
|
|
|
((Mob) awonpc).setCombatTarget(null); |
|
|
|
((Mob) awonpc).setCombatTarget(null); |
|
|
|
lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii()); |
|
|
|
lcm = new LoadCharacterMsg(awonpc, PlayerManager.hideNonAscii()); |
|
|
|
|
|
|
|
|
|
|
|
} else if ((awo.getObjectTypeMask() & MBServerStatics.MASK_NPC) != 0) { |
|
|
|
} else if ((awo.getObjectTypeMask() & MBServerStatics.MASK_NPC) != 0) { |
|
|
|
NPC awonpc = (NPC) awo; |
|
|
|
NPC awonpc = (NPC) awo; |
|
|
|
lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii()); |
|
|
|
lcm = new LoadCharacterMsg(awonpc, PlayerManager.hideNonAscii()); |
|
|
|
} else if ((awo.getObjectTypeMask() & MBServerStatics.MASK_PET) != 0) { |
|
|
|
} else if ((awo.getObjectTypeMask() & MBServerStatics.MASK_PET) != 0) { |
|
|
|
Mob awonpc = (Mob) awo; |
|
|
|
Mob awonpc = (Mob) awo; |
|
|
|
|
|
|
|
|
|
|
@ -482,7 +483,7 @@ public enum InterestManager implements Runnable { |
|
|
|
if ((awonpc.agentType.equals(Enum.AIAgentType.MOBILE))) |
|
|
|
if ((awonpc.agentType.equals(Enum.AIAgentType.MOBILE))) |
|
|
|
((Mob) awonpc).setCombatTarget(null); |
|
|
|
((Mob) awonpc).setCombatTarget(null); |
|
|
|
|
|
|
|
|
|
|
|
lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii()); |
|
|
|
lcm = new LoadCharacterMsg(awonpc, PlayerManager.hideNonAscii()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
addToList.add(awo); |
|
|
|
addToList.add(awo); |
|
|
@ -518,8 +519,8 @@ public enum InterestManager implements Runnable { |
|
|
|
|
|
|
|
|
|
|
|
// Update loaded upbjects lists
|
|
|
|
// Update loaded upbjects lists
|
|
|
|
|
|
|
|
|
|
|
|
player.isBoxed = PlayerCharacter.checkIfBoxed(player); |
|
|
|
player.isBoxed = PlayerManager.checkIfBoxed(player); |
|
|
|
player.setDirtyLoad(true); |
|
|
|
PlayerManager.setDirtyLoad(player, true); |
|
|
|
updateStaticList(player, origin); |
|
|
|
updateStaticList(player, origin); |
|
|
|
updateMobileList(player, origin); |
|
|
|
updateMobileList(player, origin); |
|
|
|
} |
|
|
|
} |
|
|
@ -536,7 +537,7 @@ public enum InterestManager implements Runnable { |
|
|
|
|
|
|
|
|
|
|
|
// Update loaded upbjects lists
|
|
|
|
// Update loaded upbjects lists
|
|
|
|
|
|
|
|
|
|
|
|
playerCharacter.setDirtyLoad(true); |
|
|
|
PlayerManager.setDirtyLoad(playerCharacter, true); |
|
|
|
updateStaticList(playerCharacter, origin); |
|
|
|
updateStaticList(playerCharacter, origin); |
|
|
|
updateMobileList(playerCharacter, origin); |
|
|
|
updateMobileList(playerCharacter, origin); |
|
|
|
|
|
|
|
|
|
|
@ -552,7 +553,7 @@ public enum InterestManager implements Runnable { |
|
|
|
for (AbstractWorldObject playerObject : playerList) { |
|
|
|
for (AbstractWorldObject playerObject : playerList) { |
|
|
|
|
|
|
|
|
|
|
|
PlayerCharacter playerCharacter = (PlayerCharacter) playerObject; |
|
|
|
PlayerCharacter playerCharacter = (PlayerCharacter) playerObject; |
|
|
|
playerCharacter.setDirtyLoad(true); |
|
|
|
PlayerManager.setDirtyLoad(playerCharacter, true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |