Browse Source

Code cleanup; reworked conditional.

master
MagicBot 2 years ago
parent
commit
6ac1911770
  1. 8
      src/engine/net/client/handlers/CityDataHandler.java

8
src/engine/net/client/handlers/CityDataHandler.java

@ -36,6 +36,7 @@ public class CityDataHandler extends AbstractClientMsgHandler {
Session playerSession; Session playerSession;
PlayerCharacter playerCharacter; PlayerCharacter playerCharacter;
Zone hotZone; Zone hotZone;
Dispatch dispatch;
playerCharacter = origin.getPlayerCharacter(); playerCharacter = origin.getPlayerCharacter();
@ -70,17 +71,16 @@ public class CityDataHandler extends AbstractClientMsgHandler {
cityDataMsg.updateMines(updateMine); cityDataMsg.updateMines(updateMine);
cityDataMsg.updateCities(updateCity); cityDataMsg.updateCities(updateCity);
Dispatch dispatch = Dispatch.borrow(playerCharacter, cityDataMsg); dispatch = Dispatch.borrow(playerCharacter, cityDataMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
if (playerCharacter.getTimeStamp("hotzoneupdate") <= WorldServer.getLastHZChange()) { // If the hotZone has changed then update the client's map accordingly.
if (hotZone != null) { if (playerCharacter.getTimeStamp("hotzoneupdate") <= WorldServer.getLastHZChange() && hotZone != null) {
HotzoneChangeMsg hotzoneChangeMsg = new HotzoneChangeMsg(Enum.GameObjectType.Zone.ordinal(), hotZone.getObjectUUID()); HotzoneChangeMsg hotzoneChangeMsg = new HotzoneChangeMsg(Enum.GameObjectType.Zone.ordinal(), hotZone.getObjectUUID());
dispatch = Dispatch.borrow(playerCharacter, hotzoneChangeMsg); dispatch = Dispatch.borrow(playerCharacter, hotzoneChangeMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
playerCharacter.setTimeStamp("hotzoneupdate", System.currentTimeMillis() - 100); playerCharacter.setTimeStamp("hotzoneupdate", System.currentTimeMillis() - 100);
}
} }
// Serialize the realms for this map // Serialize the realms for this map

Loading…
Cancel
Save