Prevent client SP value overflow.
This commit is contained in:
@@ -346,9 +346,9 @@ MinAbnormalStateSuccessRate = 10
|
||||
MaxAbnormalStateSuccessRate = 90
|
||||
|
||||
# Maximum amount of SP a character can posses.
|
||||
# Current retail limit is 50 billion, use -1 to set it to unlimited.
|
||||
# Default: 50000000000
|
||||
MaxSp = 50000000000
|
||||
# Current retail limit is max integer number, use -1 to set it to unlimited.
|
||||
# Default: 2147483647
|
||||
MaxSp = 2000000000
|
||||
|
||||
# Maximum number of allowed subclasses for every player.
|
||||
# Default: 3
|
||||
|
||||
@@ -18,6 +18,7 @@ package handlers.admincommandhandlers;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ClassListData;
|
||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
@@ -133,7 +134,7 @@ public class AdminExpSp implements IAdminCommandHandler
|
||||
try
|
||||
{
|
||||
expval = Long.parseLong(exp);
|
||||
spval = Long.parseLong(sp);
|
||||
spval = Math.min(Long.parseLong(sp), Config.MAX_SP);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -172,11 +173,11 @@ public class AdminExpSp implements IAdminCommandHandler
|
||||
final String exp = st.nextToken();
|
||||
final String sp = st.nextToken();
|
||||
long expval = 0;
|
||||
int spval = 0;
|
||||
long spval = 0;
|
||||
try
|
||||
{
|
||||
expval = Long.parseLong(exp);
|
||||
spval = Integer.parseInt(sp);
|
||||
spval = Long.parseLong(sp);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user