Prevent client SP value overflow.
This commit is contained in:
@@ -29,7 +29,7 @@ public class CharSelectInfoPackage
|
||||
private String _name;
|
||||
private int _objectId = 0;
|
||||
private long _exp = 0;
|
||||
private int _sp = 0;
|
||||
private long _sp = 0;
|
||||
private int _clanId = 0;
|
||||
private int _race = 0;
|
||||
private int _classId = 0;
|
||||
@@ -302,12 +302,12 @@ public class CharSelectInfoPackage
|
||||
_sex = sex;
|
||||
}
|
||||
|
||||
public int getSp()
|
||||
public long getSp()
|
||||
{
|
||||
return _sp;
|
||||
}
|
||||
|
||||
public void setSp(int sp)
|
||||
public void setSp(long sp)
|
||||
{
|
||||
_sp = sp;
|
||||
}
|
||||
|
@@ -6715,7 +6715,7 @@ public final class L2PcInstance extends L2Playable
|
||||
player.getStat().setExp(rset.getLong("exp"));
|
||||
player.setExpBeforeDeath(rset.getLong("expBeforeDeath"));
|
||||
player.getStat().setLevel(rset.getByte("level"));
|
||||
player.getStat().setSp(rset.getInt("sp"));
|
||||
player.getStat().setSp(rset.getLong("sp"));
|
||||
|
||||
player.setWantsPeace(rset.getInt("wantspeace"));
|
||||
|
||||
@@ -7031,7 +7031,7 @@ public final class L2PcInstance extends L2Playable
|
||||
subClass.setClassId(rs.getInt("class_id"));
|
||||
subClass.setLevel(rs.getByte("level"));
|
||||
subClass.setExp(rs.getLong("exp"));
|
||||
subClass.setSp(rs.getInt("sp"));
|
||||
subClass.setSp(rs.getLong("sp"));
|
||||
subClass.setClassIndex(rs.getInt("class_index"));
|
||||
|
||||
// Enforce the correct indexing of _subClasses against their class indexes.
|
||||
|
@@ -117,7 +117,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
|
||||
packet.writeF(charInfoPackage.getCurrentHp());
|
||||
packet.writeF(charInfoPackage.getCurrentMp());
|
||||
|
||||
packet.writeD(charInfoPackage.getSp());
|
||||
packet.writeD((int) charInfoPackage.getSp());
|
||||
packet.writeQ(charInfoPackage.getExp());
|
||||
packet.writeF((float) (charInfoPackage.getExp() - ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel())) / (ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel() + 1) - ExperienceData.getInstance().getExpForLevel(charInfoPackage.getLevel()))); // High
|
||||
// Five
|
||||
@@ -259,7 +259,7 @@ public class CharSelectionInfo implements IClientOutgoingPacket
|
||||
charInfopackage.setSex(chardata.getInt("sex"));
|
||||
|
||||
charInfopackage.setExp(chardata.getLong("exp"));
|
||||
charInfopackage.setSp(chardata.getInt("sp"));
|
||||
charInfopackage.setSp(chardata.getLong("sp"));
|
||||
charInfopackage.setVitalityPoints(chardata.getInt("vitality_points"));
|
||||
charInfopackage.setClanId(chardata.getInt("clanid"));
|
||||
|
||||
|
Reference in New Issue
Block a user