Reformatted file.
This commit is contained in:
@@ -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) {
|
||||
@@ -205,8 +205,8 @@ public enum ZoneManager {
|
||||
hotzone = ZoneManager.getZoneByUUID(zoneArray.get(entryIndex));
|
||||
|
||||
|
||||
if (hotzone == null){
|
||||
Logger.error( "Hotzone is null");
|
||||
if (hotzone == null) {
|
||||
Logger.error("Hotzone is null");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ public enum ZoneManager {
|
||||
if (zone.equals(ZoneManager.seaFloor))
|
||||
return false;
|
||||
//no duplicate hotzones
|
||||
if(zone.hasBeenHotzone == true){
|
||||
if (zone.hasBeenHotzone == true) {
|
||||
return false;
|
||||
}
|
||||
// return false; //first time setting, accept it
|
||||
@@ -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 {
|
||||
localCoords.setY((serverZone.getBounds().getHalfExtents().y * 2) - localCoords.y);
|
||||
|
||||
|
||||
|
||||
|
||||
// TODO : Make sure this value does not go outside the zone's bounds.
|
||||
|
||||
return localCoords;
|
||||
@@ -332,7 +329,7 @@ public enum ZoneManager {
|
||||
// handle building rotation
|
||||
// handle building translation
|
||||
|
||||
return building.getLoc().add(rotatedLocal.x, rotatedLocal.y,rotatedLocal.z);
|
||||
return building.getLoc().add(rotatedLocal.x, rotatedLocal.y, rotatedLocal.z);
|
||||
}
|
||||
|
||||
|
||||
@@ -346,11 +343,11 @@ public enum ZoneManager {
|
||||
// handle building rotation
|
||||
// handle building translation
|
||||
|
||||
return new Vector3f(building.getLoc().add(rotatedLocal.x, rotatedLocal.y,rotatedLocal.z));
|
||||
return new Vector3f(building.getLoc().add(rotatedLocal.x, rotatedLocal.y, rotatedLocal.z));
|
||||
}
|
||||
|
||||
public static Vector3fImmutable convertWorldToLocal(Building building, Vector3fImmutable WorldPos) {
|
||||
Vector3fImmutable convertLoc = Vector3fImmutable.rotateAroundPoint(building.getLoc(),WorldPos,-building.getBounds().getQuaternion().angleY);
|
||||
Vector3fImmutable convertLoc = Vector3fImmutable.rotateAroundPoint(building.getLoc(), WorldPos, -building.getBounds().getQuaternion().angleY);
|
||||
|
||||
|
||||
convertLoc = convertLoc.subtract(building.getLoc());
|
||||
@@ -426,7 +423,6 @@ public enum ZoneManager {
|
||||
zoneList = currentZone.getNodes();
|
||||
|
||||
|
||||
|
||||
for (Zone zone : zoneList) {
|
||||
|
||||
if (zone.isContininent())
|
||||
|
||||
@@ -26,7 +26,7 @@ public enum Protocol {
|
||||
ACTIVATECHARTER(0x296C0B22, UseCharterMsg.class, null),// Use Guild Charter
|
||||
ACTIVATENPC(0xC9AAE81E, ActivateNPCMessage.class, ActivateNPCMsgHandler.class),
|
||||
ACTIVATEPLEDGE(0x5A694DC0, SwearInMsg.class, SwearInHandler.class), // Swear In
|
||||
ADDFRIEND(0xCFA1C787,AddFriendMessage.class,null),
|
||||
ADDFRIEND(0xCFA1C787, AddFriendMessage.class, null),
|
||||
ALLIANCECHANGE(0x0E7D0B57, AllianceChangeMsg.class, AllianceChangeMsgHandler.class), // Remove From Allies/Enemies List
|
||||
ALLYENEMYLIST(0xAEA443FD, AllyEnemyListMsg.class, AllyEnemyListMsgHandler.class),
|
||||
ARCCOMBATMODEATTACKING(0xD8B10579, SetCombatModeMsg.class, null), // Attack From Outside Combat Mode
|
||||
@@ -79,7 +79,7 @@ public enum Protocol {
|
||||
CLAIMASSET(0x948C62CC, ClaimAssetMsg.class, ClaimAssetMsgHandler.class), // ClaimAsset
|
||||
CLAIMGUILDTREE(0xFD1C6442, ClaimGuildTreeMsg.class, ClaimGuildTreeMsgHandler.class),
|
||||
CLIENTADMINCOMMAND(0x624EAB5F, ClientAdminCommandMsg.class, null), //Admin Command
|
||||
CLIENTUPDATEVAULT( 0x66EDBECD, UpdateVaultMsg.class, null),
|
||||
CLIENTUPDATEVAULT(0x66EDBECD, UpdateVaultMsg.class, null),
|
||||
COMBATMODE(0xFE4BF353, ToggleCombatMsg.class, null), //Toggle Combat mode
|
||||
CONFIRMPROMOTE(0x153BB5F9, ConfirmPromoteMsg.class, null),
|
||||
COSTTOOPENBANK(0x135BE5E8, AckBankWindowOpenedMsg.class, null), // ACK Bank Window Opened
|
||||
@@ -95,8 +95,8 @@ public enum Protocol {
|
||||
EQUIP(0x3CB1AF8C, TransferItemFromInventoryToEquipMsg.class, null), // Transfer Item from Inventory to Equip
|
||||
EXPERIENCE(0xC57802A7, GrantExperienceMsg.class, null), //TODO rename once identified
|
||||
FORGETOBJECTS(0xE307A0E1, UnloadObjectsMsg.class, null), // Unload Objects
|
||||
FRIENDACCEPT(0xCA297870,AcceptFriendMsg.class,FriendAcceptHandler.class),
|
||||
FRIENDDECLINE(0xF08FC279,DeclineFriendMsg.class,FriendDeclineHandler.class),
|
||||
FRIENDACCEPT(0xCA297870, AcceptFriendMsg.class, FriendAcceptHandler.class),
|
||||
FRIENDDECLINE(0xF08FC279, DeclineFriendMsg.class, FriendDeclineHandler.class),
|
||||
FURNITURE(0xCE7FA503, FurnitureMsg.class, FurnitureHandler.class),
|
||||
GAMESERVERIPRESPONSE(0x6C95CF87, GameServerIPResponseMsg.class, null), // Game Server IP Response
|
||||
GLOBALCHANNELMESSAGE(0x2bf03fd2, null, null),
|
||||
@@ -109,7 +109,7 @@ public enum Protocol {
|
||||
GUILDMEMBERONLINE(0x7B79EB3A, GuildEnterWorldMsg.class, null), // Send Enter World Message to Guild
|
||||
GUILDRANKCHANGE(0x0DEFB21F, ChangeRankMsg.class, ChangeRankHandler.class), // Change Rank
|
||||
GUILDTREESTATUS(0x4B95FB85, GuildTreeStatusMsg.class, null),
|
||||
HIRELINGSERVICE(0xD3D93322,HirelingServiceMsg.class,HirelingServiceMsgHandler.class),
|
||||
HIRELINGSERVICE(0xD3D93322, HirelingServiceMsg.class, HirelingServiceMsgHandler.class),
|
||||
IGNORE(0xBD8881EE, IgnoreMsg.class, null), //client sent /ignore command
|
||||
INITIATETRADEHUDS(0x667D29D8, OpenTradeWindowMsg.class, null), // Open Trade Window
|
||||
INVITEGROUP(0x004A2012, GroupInviteMsg.class, GroupInviteHandler.class), // Send/Receive/Deny Group Invite
|
||||
@@ -168,7 +168,7 @@ public enum Protocol {
|
||||
RECOMMENDNATION(0x6D4579E9, RecommendNationMsg.class, RecommendNationMsgHandler.class), // Recommend as Ally/Enemy, error
|
||||
RECYCLEPOWER(0x24033B67, RecyclePowerMsg.class, null), //Unlock power for reUse
|
||||
REMOVECHAR(0x5D3F9739, DeleteCharacterMsg.class, null), // Delete Character
|
||||
REMOVEFRIEND(0xE0D5DB42,RemoveFriendMessage.class,RemoveFriendHandler.class),
|
||||
REMOVEFRIEND(0xE0D5DB42, RemoveFriendMessage.class, RemoveFriendHandler.class),
|
||||
REPAIRBUILDING(0xAF8C2560, RepairBuildingMsg.class, RepairBuildingMsgHandler.class),
|
||||
REPAIROBJECT(0x782219CE, RepairMsg.class, null), //Repair Window Req/Ack, RepairObject item Req/Ack
|
||||
REQUESTCONTENTS(0xA786B0A2, LootWindowRequestMsg.class, null), // MoveObjectToContainer Window Request
|
||||
@@ -179,7 +179,7 @@ public enum Protocol {
|
||||
REQUESTTOTRADE(0x4D84259B, TradeRequestMsg.class, null), // Trade Request
|
||||
REQUESTTRADECANCEL(0xCB0C5735, RejectTradeRequestMsg.class, null), // Reject RequestToTrade
|
||||
REQUESTTRADEOK(0xFFD29841, AcceptTradeRequestMsg.class, null), // Accept Trade Request
|
||||
RESETAFTERDEATH(0xFDCBB98F,RespawnMsg.class, null), //Respawn Request/Response
|
||||
RESETAFTERDEATH(0xFDCBB98F, RespawnMsg.class, null), //Respawn Request/Response
|
||||
ROTATEMSG(0x57F2088E, RotateObjectMsg.class, null),
|
||||
SAFEMODE(0x9CF3922A, SafeModeMsg.class, null), //Tell client they're in safe mode
|
||||
SCALEOBJECT(0xE2B392D9, null, null), // Adjust scale of object
|
||||
@@ -210,7 +210,7 @@ public enum Protocol {
|
||||
TAXCITY(0xCD41EAA6, TaxCityMsg.class, TaxCityMsgHandler.class),
|
||||
TAXRESOURCES(0x4AD458AF, TaxResourcesMsg.class, TaxResourcesMsgHandler.class),
|
||||
TELEPORT(0x23E726EA, TeleportToPointMsg.class, null), // Teleport to point
|
||||
TERRITORYCHANGE(0x6B388C8C,TerritoryChangeMessage.class, null), //Hey rich, look what I found? :)
|
||||
TERRITORYCHANGE(0x6B388C8C, TerritoryChangeMessage.class, null), //Hey rich, look what I found? :)
|
||||
TOGGLESITSTAND(0x624F3C0F, ToggleSitStandMsg.class, null), //Toggle Sit/Stand
|
||||
TRADEADDGOLD(0x654ACB45, AddGoldToTradeWindowMsg.class, null), // Add Gold to Trade Window
|
||||
TRADEADDOBJECT(0x55D363E9, AddItemToTradeWindowMsg.class, null), // Add an Item to the Trade Window
|
||||
@@ -227,7 +227,7 @@ public enum Protocol {
|
||||
TRANSFERITEMFROMVAULTTOINVENTORY(0x0119A64D, TransferItemFromVaultToInventoryMsg.class, null), // Transfer Item from Vault to Inventory
|
||||
TRANSFERITEMTOBANK(0xD48C46FA, TransferItemFromInventoryToBankMsg.class, null), // Transfer Item from Inventory to Bank
|
||||
UNEQUIP(0xC6BFB907, TransferItemFromEquipToInventoryMsg.class, null), // Transfer Item from Equip to Inventory
|
||||
UNKNOWN(0x238C9259, UnknownMsg.class,null),
|
||||
UNKNOWN(0x238C9259, UnknownMsg.class, null),
|
||||
UPDATECHARORMOB(0xB6D78961, null, null),
|
||||
UPDATECLIENTALLIANCES(0xF3FEB5D4, null, GuildUnknownHandler.class), //AlliancesMsg
|
||||
UPDATECLIENTINVENTORIES(0xE66F533D, UpdateInventoryMsg.class, null), //Update player inventory
|
||||
@@ -247,14 +247,14 @@ public enum Protocol {
|
||||
WEIGHTINVENTORY(0xF1B6A85C, LootWindowResponseMsg.class, null), // MoveObjectToContainer Window Response
|
||||
WHOREQUEST(0xF431CCE9, WhoRequestMsg.class, null), // Request /who
|
||||
WHORESPONSE(0xD7C36568, WhoResponseMsg.class, null), // Response /who
|
||||
REQUESTBALLLIST(0xE366FF64,RequestBallListMessage.class,RequestBallListHandler.class),
|
||||
SENDBALLENTRY(0xAC2B5EDC,SendBallEntryMessage.class,SendBallEntryHandler.class),
|
||||
UNKNOWN1(-263523523, Unknown1Msg.class,null),
|
||||
DROPGOLD(1461654160,DropGoldMsg.class,null);
|
||||
REQUESTBALLLIST(0xE366FF64, RequestBallListMessage.class, RequestBallListHandler.class),
|
||||
SENDBALLENTRY(0xAC2B5EDC, SendBallEntryMessage.class, SendBallEntryHandler.class),
|
||||
UNKNOWN1(-263523523, Unknown1Msg.class, null),
|
||||
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 {
|
||||
}
|
||||
}
|
||||
|
||||
private static HashMap<Integer, Protocol> _protocolMsgByOpcode = new HashMap<>();
|
||||
private static final HashMap<Integer, Protocol> _protocolMsgByOpcode = new HashMap<>();
|
||||
|
||||
public static Protocol getByOpcode(int opcode) {
|
||||
|
||||
@@ -302,7 +302,7 @@ public enum Protocol {
|
||||
|
||||
for (Protocol protocol : Protocol.values()) {
|
||||
|
||||
if (_protocolMsgByOpcode.containsKey(protocol.opcode)){
|
||||
if (_protocolMsgByOpcode.containsKey(protocol.opcode)) {
|
||||
Logger.error("Duplicate opcodes for " + protocol.name() + " and " + _protocolMsgByOpcode.get(protocol.opcode).name());
|
||||
}
|
||||
_protocolMsgByOpcode.put(protocol.opcode, protocol);
|
||||
@@ -310,21 +310,21 @@ public enum Protocol {
|
||||
}
|
||||
|
||||
|
||||
public static int FindNextValidOpcode(ByteBufferReader reader){
|
||||
public static int FindNextValidOpcode(ByteBufferReader reader) {
|
||||
int startPos = reader.position();
|
||||
int bytesLeft = reader.remaining();
|
||||
|
||||
if (bytesLeft < 4)
|
||||
return startPos;
|
||||
int nextPos = startPos;
|
||||
for (int i = 1; i< bytesLeft; i++ ){
|
||||
for (int i = 1; i < bytesLeft; i++) {
|
||||
reader.position(nextPos);
|
||||
if (reader.remaining() < 4)
|
||||
return reader.position();
|
||||
int newOpcode = reader.getInt();
|
||||
|
||||
Protocol foundProtocol = Protocol.getByOpcode(newOpcode);
|
||||
if (foundProtocol.equals(Protocol.NONE)){
|
||||
if (foundProtocol.equals(Protocol.NONE)) {
|
||||
nextPos += 1;
|
||||
continue;
|
||||
}
|
||||
@@ -334,5 +334,5 @@ public static int FindNextValidOpcode(ByteBufferReader reader){
|
||||
}
|
||||
|
||||
return startPos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
@@ -56,12 +56,12 @@ public class CityDataHandler extends AbstractClientMsgHandler {
|
||||
// No reason to serialize cities and mines everytime map is
|
||||
// opened. Wait until something has changed.
|
||||
|
||||
if (playerCharacter.getTimeStamp("mineupdate") <= Mine.getLastChange()){
|
||||
if (playerCharacter.getTimeStamp("mineupdate") <= Mine.getLastChange()) {
|
||||
playerCharacter.setTimeStamp("mineupdate", System.currentTimeMillis());
|
||||
updateMine = true;
|
||||
}
|
||||
|
||||
if (playerCharacter.getTimeStamp("cityUpdate") <= City.lastCityUpdate){
|
||||
if (playerCharacter.getTimeStamp("cityUpdate") <= City.lastCityUpdate) {
|
||||
playerCharacter.setTimeStamp("cityUpdate", System.currentTimeMillis());
|
||||
updateCity = true;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
/**
|
||||
* 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 {
|
||||
* 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;
|
||||
}
|
||||
@@ -108,10 +105,10 @@ public class cityDataMsg extends ClientNetMsg {
|
||||
if (map != null) {
|
||||
for (AbstractGameObject ago : map.values())
|
||||
if (ago.getObjectType().equals(Enum.GameObjectType.City))
|
||||
cityList.add((City)ago);
|
||||
cityList.add((City) ago);
|
||||
|
||||
writer.putInt(cityList.size());
|
||||
for (City city: cityList){
|
||||
for (City city : cityList) {
|
||||
City.serializeForClientMsg(city, writer);
|
||||
}
|
||||
|
||||
@@ -129,7 +126,7 @@ public class cityDataMsg extends ClientNetMsg {
|
||||
writer.put((byte) 0);
|
||||
writer.putInt(Runegate._runegates.values().size());
|
||||
|
||||
for(Runegate runegate : Runegate._runegates.values()) {
|
||||
for (Runegate runegate : Runegate._runegates.values()) {
|
||||
runegate._serializeForEnterWorld(writer);
|
||||
}
|
||||
} else
|
||||
@@ -137,24 +134,23 @@ public class cityDataMsg extends ClientNetMsg {
|
||||
|
||||
|
||||
//Handle Mine updates
|
||||
try{
|
||||
try {
|
||||
if (this.updateMines) {
|
||||
ArrayList<Mine> mineList = new ArrayList<>();
|
||||
for (Mine toAdd: Mine.mineMap.keySet()){
|
||||
for (Mine toAdd : Mine.mineMap.keySet()) {
|
||||
mineList.add(toAdd);
|
||||
}
|
||||
|
||||
writer.putInt(mineList.size());
|
||||
for (Mine mine: mineList)
|
||||
for (Mine mine : mineList)
|
||||
Mine.serializeForClientMsg(mine, writer);
|
||||
} else
|
||||
writer.putInt(0);
|
||||
}catch(Exception e){
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
|
||||
|
||||
writer.put((byte) 0); // PAD
|
||||
}
|
||||
|
||||
@@ -198,11 +194,11 @@ public class cityDataMsg extends ClientNetMsg {
|
||||
for (AbstractGameObject ago : map.values())
|
||||
|
||||
if (ago.getObjectType().equals(Enum.GameObjectType.City))
|
||||
cityList.add((City)ago);
|
||||
cityList.add((City) ago);
|
||||
|
||||
temp.putInt(cityList.size());
|
||||
|
||||
for (City city: cityList)
|
||||
for (City city : cityList)
|
||||
City.serializeForClientMsg(city, temp);
|
||||
temp.put((byte) 0); // PAD
|
||||
|
||||
@@ -210,17 +206,17 @@ public class cityDataMsg extends ClientNetMsg {
|
||||
|
||||
temp.putInt(Runegate._runegates.values().size());
|
||||
|
||||
for(Runegate runegate : Runegate._runegates.values()) {
|
||||
for (Runegate runegate : Runegate._runegates.values()) {
|
||||
runegate._serializeForEnterWorld(temp);
|
||||
}
|
||||
|
||||
ArrayList<Mine> mineList = new ArrayList<>();
|
||||
for (Mine toAdd : Mine.mineMap.keySet()){
|
||||
for (Mine toAdd : Mine.mineMap.keySet()) {
|
||||
mineList.add(toAdd);
|
||||
}
|
||||
|
||||
temp.putInt(mineList.size());
|
||||
for (Mine mine: mineList)
|
||||
for (Mine mine : mineList)
|
||||
Mine.serializeForClientMsg(mine, temp);
|
||||
temp.put((byte) 0); // PAD
|
||||
}
|
||||
@@ -229,18 +225,17 @@ 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();
|
||||
|
||||
if (type == 1){
|
||||
if (type == 1) {
|
||||
reader.get();
|
||||
reader.get();
|
||||
reader.getInt();
|
||||
|
||||
}else{
|
||||
} else {
|
||||
reader.get();
|
||||
reader.getInt();
|
||||
reader.get();
|
||||
|
||||
@@ -43,12 +43,12 @@ public class HourlyJobThread implements Runnable {
|
||||
|
||||
try {
|
||||
Zone hotzone = ZoneManager.getHotZone();
|
||||
if(hotzone == null){
|
||||
if (hotzone == null) {
|
||||
//no hotzone? set one.
|
||||
ZoneManager.generateAndSetRandomHotzone();
|
||||
}
|
||||
int hotzoneDuration = Integer.valueOf(ConfigManager.MB_HOTZONE_DURATION.getValue());
|
||||
if(((LocalDateTime.now().getHour()) - hotzone.becameHotzone.getHour()) >= hotzoneDuration) {
|
||||
if (((LocalDateTime.now().getHour()) - hotzone.becameHotzone.getHour()) >= hotzoneDuration) {
|
||||
ZoneManager.generateAndSetRandomHotzone();
|
||||
hotzone = ZoneManager.getHotZone();
|
||||
}
|
||||
@@ -187,7 +187,7 @@ public class HourlyJobThread implements Runnable {
|
||||
ArrayList<Mine> mines = Mine.getMines();
|
||||
|
||||
for (Mine mine : mines) {
|
||||
if(LocalDateTime.now().getHour() == 1400){
|
||||
if (LocalDateTime.now().getHour() == 1400) {
|
||||
mine.wasClaimed = false;
|
||||
}
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user