forked from MagicBane/Server
Reformatted file.
This commit is contained in:
@@ -39,12 +39,12 @@ public enum ZoneManager {
|
|||||||
/* Instance variables */
|
/* Instance variables */
|
||||||
private static Zone seaFloor = null;
|
private static Zone seaFloor = null;
|
||||||
private static Zone hotzone = null;
|
private static Zone hotzone = null;
|
||||||
private static ConcurrentHashMap<Integer, Zone> zonesByID = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD);
|
private static final ConcurrentHashMap<Integer, Zone> zonesByID = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD);
|
||||||
private static ConcurrentHashMap<Integer, Zone> zonesByUUID = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD);
|
private static final ConcurrentHashMap<Integer, Zone> zonesByUUID = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD);
|
||||||
private static ConcurrentHashMap<String, Zone> zonesByName = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD);
|
private static final ConcurrentHashMap<String, Zone> zonesByName = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD);
|
||||||
private static Set<Zone> macroZones = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
private static final Set<Zone> macroZones = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||||
private static Set<Zone> npcCityZones = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
private static final Set<Zone> npcCityZones = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||||
private static Set<Zone> playerCityZones = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
private static final Set<Zone> playerCityZones = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||||
// Find all zones coordinates fit into, starting with Sea Floor
|
// Find all zones coordinates fit into, starting with Sea Floor
|
||||||
|
|
||||||
public static ArrayList<Zone> getAllZonesIn(final Vector3fImmutable loc) {
|
public static ArrayList<Zone> getAllZonesIn(final Vector3fImmutable loc) {
|
||||||
@@ -243,8 +243,7 @@ public enum ZoneManager {
|
|||||||
/**
|
/**
|
||||||
* Gets a MacroZone by name.
|
* Gets a MacroZone by name.
|
||||||
*
|
*
|
||||||
* @param inputName
|
* @param inputName MacroZone name to search for
|
||||||
* MacroZone name to search for
|
|
||||||
* @return Zone of the MacroZone, or Null
|
* @return Zone of the MacroZone, or Null
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -292,8 +291,6 @@ public enum ZoneManager {
|
|||||||
localCoords.setY((serverZone.getBounds().getHalfExtents().y * 2) - localCoords.y);
|
localCoords.setY((serverZone.getBounds().getHalfExtents().y * 2) - localCoords.y);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TODO : Make sure this value does not go outside the zone's bounds.
|
// TODO : Make sure this value does not go outside the zone's bounds.
|
||||||
|
|
||||||
return localCoords;
|
return localCoords;
|
||||||
@@ -426,7 +423,6 @@ public enum ZoneManager {
|
|||||||
zoneList = currentZone.getNodes();
|
zoneList = currentZone.getNodes();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (Zone zone : zoneList) {
|
for (Zone zone : zoneList) {
|
||||||
|
|
||||||
if (zone.isContininent())
|
if (zone.isContininent())
|
||||||
|
|||||||
@@ -253,8 +253,8 @@ public enum Protocol {
|
|||||||
DROPGOLD(1461654160, DropGoldMsg.class, null);
|
DROPGOLD(1461654160, DropGoldMsg.class, null);
|
||||||
|
|
||||||
public int opcode;
|
public int opcode;
|
||||||
private Class message;
|
private final Class message;
|
||||||
private Class handlerClass;
|
private final Class handlerClass;
|
||||||
public Constructor constructor;
|
public Constructor constructor;
|
||||||
public AbstractClientMsgHandler handler;
|
public AbstractClientMsgHandler handler;
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ public enum Protocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static HashMap<Integer, Protocol> _protocolMsgByOpcode = new HashMap<>();
|
private static final HashMap<Integer, Protocol> _protocolMsgByOpcode = new HashMap<>();
|
||||||
|
|
||||||
public static Protocol getByOpcode(int opcode) {
|
public static Protocol getByOpcode(int opcode) {
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import engine.session.Session;
|
|||||||
/*
|
/*
|
||||||
* @Author:
|
* @Author:
|
||||||
* @Summary: Processes application protocol message which displays
|
* @Summary: Processes application protocol message which displays
|
||||||
* the map interface. (Zones, Cities, Realms, Hotzones)
|
* the map interface. (Zones, Cities, Realms, Hot-zones)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class CityDataHandler extends AbstractClientMsgHandler {
|
public class CityDataHandler extends AbstractClientMsgHandler {
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
public class cityDataMsg extends ClientNetMsg {
|
public class cityDataMsg extends ClientNetMsg {
|
||||||
|
|
||||||
private Session s;
|
private Session s;
|
||||||
private boolean forEnterWorld;
|
private final boolean forEnterWorld;
|
||||||
private static ByteBuffer cachedEnterWorld;
|
private static ByteBuffer cachedEnterWorld;
|
||||||
private static long cachedExpireTime;
|
private static long cachedExpireTime;
|
||||||
|
|
||||||
public static final long wdComp = 0xFF00FF0000000003L;
|
public static final long wdComp = 0xFF00FF0000000003L;
|
||||||
private static byte ver = 1;
|
private static final byte ver = 1;
|
||||||
|
|
||||||
private boolean updateCities = false;
|
private boolean updateCities = false;
|
||||||
private boolean updateRunegates = false;
|
private boolean updateRunegates = false;
|
||||||
@@ -44,10 +44,8 @@ public class cityDataMsg extends ClientNetMsg {
|
|||||||
/**
|
/**
|
||||||
* This is the general purpose constructor.
|
* This is the general purpose constructor.
|
||||||
*
|
*
|
||||||
* @param s
|
* @param s Session
|
||||||
* Session
|
* @param forEnterWorld boolean flag
|
||||||
* @param forEnterWorld
|
|
||||||
* boolean flag
|
|
||||||
*/
|
*/
|
||||||
public cityDataMsg(Session s, boolean forEnterWorld) {
|
public cityDataMsg(Session s, boolean forEnterWorld) {
|
||||||
super(Protocol.CITYDATA);
|
super(Protocol.CITYDATA);
|
||||||
@@ -70,8 +68,7 @@ public class cityDataMsg extends ClientNetMsg {
|
|||||||
* past the limit) then this constructor Throws that Exception to the
|
* past the limit) then this constructor Throws that Exception to the
|
||||||
* caller.
|
* caller.
|
||||||
*/
|
*/
|
||||||
public cityDataMsg(AbstractConnection origin, ByteBufferReader reader)
|
public cityDataMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||||
{
|
|
||||||
super(Protocol.CITYDATA, origin, reader);
|
super(Protocol.CITYDATA, origin, reader);
|
||||||
this.forEnterWorld = false;
|
this.forEnterWorld = false;
|
||||||
}
|
}
|
||||||
@@ -154,7 +151,6 @@ public class cityDataMsg extends ClientNetMsg {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
writer.put((byte) 0); // PAD
|
writer.put((byte) 0); // PAD
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,8 +225,7 @@ public class cityDataMsg extends ClientNetMsg {
|
|||||||
* Deserializes the subclass specific items from the supplied NetMsgReader.
|
* Deserializes the subclass specific items from the supplied NetMsgReader.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void _deserialize(ByteBufferReader reader)
|
protected void _deserialize(ByteBufferReader reader) {
|
||||||
{
|
|
||||||
// Client only sends 11 bytes.
|
// Client only sends 11 bytes.
|
||||||
|
|
||||||
byte type = reader.get();
|
byte type = reader.get();
|
||||||
|
|||||||
Reference in New Issue
Block a user