Refactored usage of HotZone; added cycle counter.

This commit is contained in:
MagicBot committed 2023-02-22 16:40:11 -05:00
1 parent 6ac1911770
commit 8ae973f5f4
7 files changed
+35 -41

No files matched your search

@@ -50,10 +50,6 @@ public class CityDataHandler extends AbstractClientMsgHandler {
if (playerSession == null)
return true;
// Cache current hotZone
hotZone = ZoneManager.getHotZone();
// No reason to serialize cities and mines everytime map is
// opened. Wait until something has changed.
@@ -76,8 +72,8 @@ public class CityDataHandler extends AbstractClientMsgHandler {
// If the hotZone has changed then update the client's map accordingly.
if (playerCharacter.getTimeStamp("hotzoneupdate") <= WorldServer.getLastHZChange() && hotZone != null) {
HotzoneChangeMsg hotzoneChangeMsg = new HotzoneChangeMsg(Enum.GameObjectType.Zone.ordinal(), hotZone.getObjectUUID());
if (playerCharacter.getTimeStamp("hotzoneupdate") <= WorldServer.getLastHZChange() && ZoneManager.hotZone != null) {
HotzoneChangeMsg hotzoneChangeMsg = new HotzoneChangeMsg(Enum.GameObjectType.Zone.ordinal(), ZoneManager.hotZone.getObjectUUID());
dispatch = Dispatch.borrow(playerCharacter, hotzoneChangeMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
playerCharacter.setTimeStamp("hotzoneupdate", System.currentTimeMillis() - 100);