Browse Source

Reformatted file.

master
MagicBot 2 years ago
parent
commit
f723e35785
  1. 18
      src/engine/gameManager/ZoneManager.java
  2. 6
      src/engine/net/client/Protocol.java
  3. 2
      src/engine/net/client/handlers/CityDataHandler.java
  4. 17
      src/engine/net/client/msg/cityDataMsg.java

18
src/engine/gameManager/ZoneManager.java

@ -39,12 +39,12 @@ public enum ZoneManager { @@ -39,12 +39,12 @@ public enum ZoneManager {
/* Instance variables */
private static Zone seaFloor = null;
private static Zone hotzone = null;
private static 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 ConcurrentHashMap<String, Zone> zonesByName = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD);
private static Set<Zone> macroZones = Collections.newSetFromMap(new ConcurrentHashMap<>());
private static Set<Zone> npcCityZones = Collections.newSetFromMap(new ConcurrentHashMap<>());
private static Set<Zone> playerCityZones = Collections.newSetFromMap(new ConcurrentHashMap<>());
private static final ConcurrentHashMap<Integer, Zone> zonesByID = 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 final ConcurrentHashMap<String, Zone> zonesByName = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD);
private static final Set<Zone> macroZones = Collections.newSetFromMap(new ConcurrentHashMap<>());
private static final Set<Zone> npcCityZones = Collections.newSetFromMap(new ConcurrentHashMap<>());
private static final Set<Zone> playerCityZones = Collections.newSetFromMap(new ConcurrentHashMap<>());
// Find all zones coordinates fit into, starting with Sea Floor
public static ArrayList<Zone> getAllZonesIn(final Vector3fImmutable loc) {
@ -243,8 +243,7 @@ public enum ZoneManager { @@ -243,8 +243,7 @@ public enum ZoneManager {
/**
* Gets a MacroZone by name.
*
* @param inputName
* MacroZone name to search for
* @param inputName MacroZone name to search for
* @return Zone of the MacroZone, or Null
*/
@ -292,8 +291,6 @@ public enum ZoneManager { @@ -292,8 +291,6 @@ public enum ZoneManager {
localCoords.setY((serverZone.getBounds().getHalfExtents().y * 2) - localCoords.y);
// TODO : Make sure this value does not go outside the zone's bounds.
return localCoords;
@ -426,7 +423,6 @@ public enum ZoneManager { @@ -426,7 +423,6 @@ public enum ZoneManager {
zoneList = currentZone.getNodes();
for (Zone zone : zoneList) {
if (zone.isContininent())

6
src/engine/net/client/Protocol.java

@ -253,8 +253,8 @@ public enum Protocol { @@ -253,8 +253,8 @@ public enum Protocol {
DROPGOLD(1461654160, DropGoldMsg.class, null);
public int opcode;
private Class message;
private Class handlerClass;
private final Class message;
private final Class handlerClass;
public Constructor constructor;
public AbstractClientMsgHandler handler;
@ -286,7 +286,7 @@ public enum Protocol { @@ -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) {

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

@ -19,7 +19,7 @@ import engine.session.Session; @@ -19,7 +19,7 @@ import engine.session.Session;
/*
* @Author:
* @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 {

17
src/engine/net/client/msg/cityDataMsg.java

@ -30,12 +30,12 @@ import java.util.concurrent.ConcurrentHashMap; @@ -30,12 +30,12 @@ import java.util.concurrent.ConcurrentHashMap;
public class cityDataMsg extends ClientNetMsg {
private Session s;
private boolean forEnterWorld;
private final boolean forEnterWorld;
private static ByteBuffer cachedEnterWorld;
private static long cachedExpireTime;
public static final long wdComp = 0xFF00FF0000000003L;
private static byte ver = 1;
private static final byte ver = 1;
private boolean updateCities = false;
private boolean updateRunegates = false;
@ -44,10 +44,8 @@ public class cityDataMsg extends ClientNetMsg { @@ -44,10 +44,8 @@ public class cityDataMsg extends ClientNetMsg {
/**
* This is the general purpose constructor.
*
* @param s
* Session
* @param forEnterWorld
* boolean flag
* @param s Session
* @param forEnterWorld boolean flag
*/
public cityDataMsg(Session s, boolean forEnterWorld) {
super(Protocol.CITYDATA);
@ -70,8 +68,7 @@ public class cityDataMsg extends ClientNetMsg { @@ -70,8 +68,7 @@ public class cityDataMsg extends ClientNetMsg {
* past the limit) then this constructor Throws that Exception to the
* caller.
*/
public cityDataMsg(AbstractConnection origin, ByteBufferReader reader)
{
public cityDataMsg(AbstractConnection origin, ByteBufferReader reader) {
super(Protocol.CITYDATA, origin, reader);
this.forEnterWorld = false;
}
@ -154,7 +151,6 @@ public class cityDataMsg extends ClientNetMsg { @@ -154,7 +151,6 @@ public class cityDataMsg extends ClientNetMsg {
}
writer.put((byte) 0); // PAD
}
@ -229,8 +225,7 @@ public class cityDataMsg extends ClientNetMsg { @@ -229,8 +225,7 @@ public class cityDataMsg extends ClientNetMsg {
* Deserializes the subclass specific items from the supplied NetMsgReader.
*/
@Override
protected void _deserialize(ByteBufferReader reader)
{
protected void _deserialize(ByteBufferReader reader) {
// Client only sends 11 bytes.
byte type = reader.get();

Loading…
Cancel
Save