Minor code format.

This commit is contained in:
MobiusDevelopment
2020-09-10 14:53:24 +00:00
parent 56cb387a10
commit 1a57435680
236 changed files with 913 additions and 881 deletions

View File

@@ -219,16 +219,16 @@ public class ShortCuts implements IRestorable
* Updates the shortcut bars with the new skill.
* @param skillId the skill Id to search and update.
* @param skillLevel the skill level to update.
* @param skillSubLevel the skill sub level to update.
* @param skillSubLevel the skill sub level to update.
*/
public synchronized void updateShortCuts(int skillId, int skillLevel, int skillSubLevel )
public synchronized void updateShortCuts(int skillId, int skillLevel, int skillSubLevel)
{
// Update all the shortcuts for this skill
for (Shortcut sc : _shortCuts.values())
{
if ((sc.getId() == skillId) && (sc.getType() == ShortcutType.SKILL))
{
final Shortcut newsc = new Shortcut(sc.getSlot(), sc.getPage(), sc.getType(), sc.getId(), skillLevel, skillSubLevel , 1);
final Shortcut newsc = new Shortcut(sc.getSlot(), sc.getPage(), sc.getType(), sc.getId(), skillLevel, skillSubLevel, 1);
_owner.sendPacket(new ShortCutRegister(newsc));
_owner.registerShortCut(newsc);
}

View File

@@ -121,7 +121,7 @@ public class TimeStamp
* Gets the skill sub level.
* @return the skill level
*/
public int getSkillSubLevel ()
public int getSkillSubLevel()
{
return _id3;
}

View File

@@ -1577,11 +1577,11 @@ public class PlayerInstance extends Playable
* Updates the shortcut bars with the new skill.
* @param skillId the skill Id to search and update.
* @param skillLevel the skill level to update.
* @param skillSubLevel the skill sub level to update.
* @param skillSubLevel the skill sub level to update.
*/
public void updateShortCuts(int skillId, int skillLevel, int skillSubLevel )
public void updateShortCuts(int skillId, int skillLevel, int skillSubLevel)
{
_shortCuts.updateShortCuts(skillId, skillLevel, skillSubLevel );
_shortCuts.updateShortCuts(skillId, skillLevel, skillSubLevel);
}
/**
@@ -7253,7 +7253,7 @@ public class PlayerInstance extends Playable
statement.setInt(1, getObjectId());
statement.setInt(2, t.getSkillId());
statement.setInt(3, t.getSkillLevel());
statement.setInt(4, t.getSkillSubLevel ());
statement.setInt(4, t.getSkillSubLevel());
statement.setInt(5, -1);
statement.setLong(6, t.getReuse());
statement.setDouble(7, t.getStamp());

View File

@@ -29,6 +29,7 @@ public enum AnnouncementType
EVENT,
AUTO_NORMAL,
AUTO_CRITICAL;
private static final Logger LOGGER = Logger.getLogger(AnnouncementType.class.getName());
public static AnnouncementType findById(int id)

View File

@@ -27,22 +27,22 @@ public class SkillHolder
{
private final int _skillId;
private final int _skillLevel;
private final int _skillSubLevel ;
private final int _skillSubLevel;
private Skill _skill;
public SkillHolder(int skillId, int skillLevel)
{
_skillId = skillId;
_skillLevel = skillLevel;
_skillSubLevel = 0;
_skillSubLevel = 0;
_skill = null;
}
public SkillHolder(int skillId, int skillLevel, int skillSubLevel )
public SkillHolder(int skillId, int skillLevel, int skillSubLevel)
{
_skillId = skillId;
_skillLevel = skillLevel;
_skillSubLevel = skillSubLevel ;
_skillSubLevel = skillSubLevel;
_skill = null;
}
@@ -50,7 +50,7 @@ public class SkillHolder
{
_skillId = skill.getId();
_skillLevel = skill.getLevel();
_skillSubLevel = skill.getSubLevel();
_skillSubLevel = skill.getSubLevel();
_skill = skill;
}
@@ -64,16 +64,16 @@ public class SkillHolder
return _skillLevel;
}
public int getSkillSubLevel ()
public int getSkillSubLevel()
{
return _skillSubLevel ;
return _skillSubLevel;
}
public Skill getSkill()
{
if (_skill == null)
{
_skill = SkillData.getInstance().getSkill(_skillId, Math.max(_skillLevel, 1), _skillSubLevel );
_skill = SkillData.getInstance().getSkill(_skillId, Math.max(_skillLevel, 1), _skillSubLevel);
}
return _skill;
}
@@ -92,7 +92,7 @@ public class SkillHolder
}
final SkillHolder holder = (SkillHolder) obj;
return (holder.getSkillId() == _skillId) && (holder.getSkillLevel() == _skillLevel) && (holder.getSkillSubLevel () == _skillSubLevel );
return (holder.getSkillId() == _skillId) && (holder.getSkillLevel() == _skillLevel) && (holder.getSkillSubLevel() == _skillSubLevel);
}
@Override
@@ -102,7 +102,7 @@ public class SkillHolder
int result = 1;
result = (prime * result) + _skillId;
result = (prime * result) + _skillLevel;
result = (prime * result) + _skillSubLevel ;
result = (prime * result) + _skillSubLevel;
return result;
}

View File

@@ -33,7 +33,7 @@ public class RequestDispel implements IClientIncomingPacket
private int _objectId;
private int _skillId;
private int _skillLevel;
private int _skillSubLevel ;
private int _skillSubLevel;
@Override
public boolean read(GameClient client, PacketReader packet)
@@ -41,7 +41,7 @@ public class RequestDispel implements IClientIncomingPacket
_objectId = packet.readD();
_skillId = packet.readD();
_skillLevel = packet.readH();
_skillSubLevel = packet.readH();
_skillSubLevel = packet.readH();
return true;
}
@@ -57,7 +57,7 @@ public class RequestDispel implements IClientIncomingPacket
{
return;
}
final Skill skill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel );
final Skill skill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel);
if (skill == null)
{
return;

View File

@@ -50,7 +50,7 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
private SkillEnchantType _type;
private int _skillId;
private int _skillLevel;
private int _skillSubLevel ;
private int _skillSubLevel;
@Override
public boolean read(GameClient client, PacketReader packet)
@@ -62,12 +62,12 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
if (level < 100)
{
_skillLevel = level;
_skillSubLevel = 0;
_skillSubLevel = 0;
}
else
{
_skillLevel = client.getPlayer().getKnownSkill(_skillId).getLevel();
_skillSubLevel = SkillEnchantConverter.levelToUnderground(level);
_skillSubLevel = SkillEnchantConverter.levelToUnderground(level);
}
return true;
}
@@ -75,7 +75,7 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
@Override
public void run(GameClient client)
{
if ((_skillId <= 0) || (_skillLevel <= 0) || (_skillSubLevel < 0))
if ((_skillId <= 0) || (_skillLevel <= 0) || (_skillSubLevel < 0))
{
return;
}
@@ -131,7 +131,7 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
{
if (_type == SkillEnchantType.CHANGE)
{
final int group1 = (_skillSubLevel % 1000);
final int group1 = (_skillSubLevel % 1000);
final int group2 = (skill.getSubLevel() % 1000);
if (group1 != group2)
{
@@ -139,14 +139,14 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
return;
}
}
else if ((_type != SkillEnchantType.UNTRAIN) && ((skill.getSubLevel() + 1) != _skillSubLevel ))
else if ((_type != SkillEnchantType.UNTRAIN) && ((skill.getSubLevel() + 1) != _skillSubLevel))
{
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Client: " + client + " send incorrect sub level: " + _skillSubLevel + " expected: " + (skill.getSubLevel() + 1));
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Client: " + client + " send incorrect sub level: " + _skillSubLevel + " expected: " + (skill.getSubLevel() + 1));
return;
}
}
final EnchantSkillHolder enchantSkillHolder = EnchantSkillGroupsData.getInstance().getEnchantSkillHolder(_skillSubLevel % 1000);
final EnchantSkillHolder enchantSkillHolder = EnchantSkillGroupsData.getInstance().getEnchantSkillHolder(_skillSubLevel % 1000);
if (_type != SkillEnchantType.UNTRAIN) // TODO: Fix properly
{
// Verify if player has all the ingredients
@@ -185,7 +185,7 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
{
if (Rnd.get(100) <= enchantSkillHolder.getChance(_type))
{
final Skill enchantedSkill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel );
final Skill enchantedSkill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel);
if (Config.LOG_SKILL_ENCHANTS)
{
LOGGER_ENCHANT.log(Level.INFO, "Success, Character:" + player.getName() + " [" + player.getObjectId() + "] Account:" + player.getAccountName() + " IP:" + player.getIPAddress() + ", +" + enchantedSkill.getLevel() + " " + enchantedSkill.getSubLevel() + " - " + enchantedSkill.getName() + " (" + enchantedSkill.getId() + "), " + enchantSkillHolder.getChance(_type));
@@ -224,7 +224,7 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
{
if (Rnd.get(100) <= enchantSkillHolder.getChance(_type))
{
final Skill enchantedSkill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel );
final Skill enchantedSkill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel);
if (Config.LOG_SKILL_ENCHANTS)
{
LOGGER_ENCHANT.info("Success, Character:" + player.getName() + " [" + player.getObjectId() + "] Account:" + player.getAccountName() + " IP:" + player.getIPAddress() + ", +" + enchantedSkill.getLevel() + " " + enchantedSkill.getSubLevel() + " - " + enchantedSkill.getName() + " (" + enchantedSkill.getId() + "), " + enchantSkillHolder.getChance(_type));
@@ -256,14 +256,14 @@ public class RequestExEnchantSkill implements IClientIncomingPacket
// TODO: Fix properly
final Skill enchantedSkill;
final SystemMessage sm;
if ((_skillSubLevel % 1000) < 1)
if ((_skillSubLevel % 1000) < 1)
{
enchantedSkill = SkillData.getInstance().getSkill(_skillId, _skillLevel);
sm = new SystemMessage(SystemMessageId.UNTRAIN_OF_ENCHANT_SKILL_WAS_SUCCESSFUL_CURRENT_LEVEL_OF_ENCHANT_SKILL_S1_BECAME_0_AND_ENCHANT_SKILL_WILL_BE_INITIALIZED);
}
else
{
enchantedSkill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel );
enchantedSkill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel);
sm = new SystemMessage(SystemMessageId.UNTRAIN_OF_ENCHANT_SKILL_WAS_SUCCESSFUL_CURRENT_LEVEL_OF_ENCHANT_SKILL_S1_HAS_BEEN_DECREASED_BY_1);
}
player.removeSkill(enchantedSkill);

View File

@@ -36,7 +36,7 @@ public class RequestExEnchantSkillInfo implements IClientIncomingPacket
{
private int _skillId;
private int _skillLevel;
private int _skillSubLevel ;
private int _skillSubLevel;
@Override
public boolean read(GameClient client, PacketReader packet)
@@ -46,12 +46,12 @@ public class RequestExEnchantSkillInfo implements IClientIncomingPacket
if (level < 100)
{
_skillLevel = level;
_skillSubLevel = 0;
_skillSubLevel = 0;
}
else
{
_skillLevel = client.getPlayer().getKnownSkill(_skillId).getLevel();
_skillSubLevel = SkillEnchantConverter.levelToUnderground(level);
_skillSubLevel = SkillEnchantConverter.levelToUnderground(level);
}
return true;
}
@@ -59,7 +59,7 @@ public class RequestExEnchantSkillInfo implements IClientIncomingPacket
@Override
public void run(GameClient client)
{
if ((_skillId <= 0) || (_skillLevel <= 0) || (_skillSubLevel < 0))
if ((_skillId <= 0) || (_skillLevel <= 0) || (_skillSubLevel < 0))
{
return;
}
@@ -75,7 +75,7 @@ public class RequestExEnchantSkillInfo implements IClientIncomingPacket
return;
}
final Skill skill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel );
final Skill skill = SkillData.getInstance().getSkill(_skillId, _skillLevel, _skillSubLevel);
if ((skill == null) || (skill.getId() != _skillId))
{
return;
@@ -87,12 +87,12 @@ public class RequestExEnchantSkillInfo implements IClientIncomingPacket
}
final Skill playerSkill = player.getKnownSkill(_skillId);
if ((playerSkill.getLevel() != _skillLevel) || (playerSkill.getSubLevel() != _skillSubLevel ))
if ((playerSkill.getLevel() != _skillLevel) || (playerSkill.getSubLevel() != _skillSubLevel))
{
return;
}
client.sendPacket(new ExEnchantSkillInfo(_skillId, _skillLevel, _skillSubLevel , playerSkill.getSubLevel()));
client.sendPacket(new ExEnchantSkillInfo(_skillId, _skillLevel, _skillSubLevel, playerSkill.getSubLevel()));
// ExEnchantSkillInfoDetail - not really necessary I think
// client.sendPacket(new ExEnchantSkillInfoDetail(SkillEnchantType.NORMAL, _skillId, _skillLevel, _skillSubLevel , activeChar));
}

View File

@@ -31,7 +31,7 @@ public class RequestExEnchantSkillInfoDetail implements IClientIncomingPacket
private SkillEnchantType _type;
private int _skillId;
private int _skillLevel;
private int _skillSubLevel ;
private int _skillSubLevel;
@Override
public boolean read(GameClient client, PacketReader packet)
@@ -42,12 +42,12 @@ public class RequestExEnchantSkillInfoDetail implements IClientIncomingPacket
if (level < 100)
{
_skillLevel = level;
_skillSubLevel = 0;
_skillSubLevel = 0;
}
else
{
_skillLevel = client.getPlayer().getKnownSkill(_skillId).getLevel();
_skillSubLevel = SkillEnchantConverter.levelToUnderground(level);
_skillSubLevel = SkillEnchantConverter.levelToUnderground(level);
}
return true;
}
@@ -55,7 +55,7 @@ public class RequestExEnchantSkillInfoDetail implements IClientIncomingPacket
@Override
public void run(GameClient client)
{
if ((_skillId <= 0) || (_skillLevel <= 0) || (_skillSubLevel < 0))
if ((_skillId <= 0) || (_skillLevel <= 0) || (_skillSubLevel < 0))
{
return;
}
@@ -65,6 +65,6 @@ public class RequestExEnchantSkillInfoDetail implements IClientIncomingPacket
{
return;
}
player.sendPacket(new ExEnchantSkillInfoDetail(_type, _skillId, _skillLevel, _skillSubLevel , player));
player.sendPacket(new ExEnchantSkillInfoDetail(_type, _skillId, _skillLevel, _skillSubLevel, player));
}
}

View File

@@ -29,14 +29,14 @@ public class ExEnchantSkillInfo implements IClientOutgoingPacket
private final int _skillId;
private final int _skillLevel;
private final int _skillSubLevel ;
private final int _skillSubLevel;
private final int _currentSubLevel;
public ExEnchantSkillInfo(int skillId, int skillLevel, int skillSubLevel , int currentSubLevel)
public ExEnchantSkillInfo(int skillId, int skillLevel, int skillSubLevel, int currentSubLevel)
{
_skillId = skillId;
_skillLevel = skillLevel;
_skillSubLevel = skillSubLevel ;
_skillSubLevel = skillSubLevel;
_currentSubLevel = currentSubLevel;
_routes = EnchantSkillGroupsData.getInstance().getRouteForSkill(_skillId, _skillLevel);
}
@@ -47,9 +47,9 @@ public class ExEnchantSkillInfo implements IClientOutgoingPacket
OutgoingPackets.EX_ENCHANT_SKILL_INFO.writeId(packet);
packet.writeD(_skillId);
packet.writeD(_skillSubLevel > 1000 ? SkillEnchantConverter.levelToErtheia(_skillSubLevel ) : _skillLevel);
packet.writeD((_skillSubLevel % 1000) == EnchantSkillGroupsData.MAX_ENCHANT_LEVEL ? 0 : 1);
packet.writeD(_skillSubLevel > 1000 ? 1 : 0);
packet.writeD(_skillSubLevel > 1000 ? SkillEnchantConverter.levelToErtheia(_skillSubLevel) : _skillLevel);
packet.writeD((_skillSubLevel % 1000) == EnchantSkillGroupsData.MAX_ENCHANT_LEVEL ? 0 : 1);
packet.writeD(_skillSubLevel > 1000 ? 1 : 0);
packet.writeD(_routes.size());
_routes.forEach(route ->
{

View File

@@ -34,12 +34,12 @@ public class ExEnchantSkillInfoDetail implements IClientOutgoingPacket
private final int _skillLevel;
private final EnchantSkillHolder _enchantSkillHolder;
public ExEnchantSkillInfoDetail(SkillEnchantType type, int skillId, int skillLevel, int skillSubLevel , PlayerInstance player)
public ExEnchantSkillInfoDetail(SkillEnchantType type, int skillId, int skillLevel, int skillSubLevel, PlayerInstance player)
{
_type = type;
_skillId = skillId;
_skillLevel = skillSubLevel > 1000 ? SkillEnchantConverter.levelToErtheia(skillSubLevel ) : skillLevel;
_enchantSkillHolder = EnchantSkillGroupsData.getInstance().getEnchantSkillHolder(skillSubLevel % 1000);
_skillLevel = skillSubLevel > 1000 ? SkillEnchantConverter.levelToErtheia(skillSubLevel) : skillLevel;
_enchantSkillHolder = EnchantSkillGroupsData.getInstance().getEnchantSkillHolder(skillSubLevel % 1000);
}
@Override

View File

@@ -25,14 +25,14 @@ public class ShortBuffStatusUpdate implements IClientOutgoingPacket
private final int _skillId;
private final int _skillLevel;
private final int _skillSubLevel ;
private final int _skillSubLevel;
private final int _duration;
public ShortBuffStatusUpdate(int skillId, int skillLevel, int skillSubLevel , int duration)
public ShortBuffStatusUpdate(int skillId, int skillLevel, int skillSubLevel, int duration)
{
_skillId = skillId;
_skillLevel = skillLevel;
_skillSubLevel = skillSubLevel ;
_skillSubLevel = skillSubLevel;
_duration = duration;
}
@@ -43,7 +43,7 @@ public class ShortBuffStatusUpdate implements IClientOutgoingPacket
packet.writeD(_skillId);
packet.writeH(_skillLevel);
packet.writeH(_skillSubLevel );
packet.writeH(_skillSubLevel);
packet.writeD(_duration);
return true;
}

View File

@@ -39,7 +39,7 @@ public class SkillCoolTime implements IClientOutgoingPacket
_currentTime = System.currentTimeMillis();
for (TimeStamp ts : player.getSkillReuseTimeStamps().values())
{
if ((_currentTime < ts.getStamp()) && !SkillData.getInstance().getSkill(ts.getSkillId(), ts.getSkillLevel(), ts.getSkillSubLevel ()).isNotBroadcastable())
if ((_currentTime < ts.getStamp()) && !SkillData.getInstance().getSkill(ts.getSkillId(), ts.getSkillLevel(), ts.getSkillSubLevel()).isNotBroadcastable())
{
_skillReuseTimeStamps.add(ts);
}

View File

@@ -43,6 +43,7 @@ public class ExBRBuyProduct implements IClientOutgoingPacket
NOT_DAY_OF_WEEK(-12),
NOT_TIME_OF_DAY(-13),
SOLD_OUT(-14);
private final int _id;
ExBrProductReplyType(int id)