Addition of ForbiddenNames configuration.
This commit is contained in:
@ -1112,6 +1112,7 @@ public class Config
|
||||
public static int DEATH_PENALTY_CHANCE;
|
||||
public static boolean EFFECT_CANCELING;
|
||||
public static boolean STORE_SKILL_COOLTIME;
|
||||
public static String[] FORBIDDEN_NAMES;
|
||||
public static byte BUFFS_MAX_AMOUNT;
|
||||
public static byte DEBUFFS_MAX_AMOUNT;
|
||||
public static boolean ENABLE_MODIFY_SKILL_DURATION;
|
||||
@ -2842,6 +2843,7 @@ public class Config
|
||||
DEATH_PENALTY_CHANCE = characterConfig.getInt("DeathPenaltyChance", 20);
|
||||
EFFECT_CANCELING = characterConfig.getBoolean("CancelLesserEffect", true);
|
||||
STORE_SKILL_COOLTIME = characterConfig.getBoolean("StoreSkillCooltime", true);
|
||||
FORBIDDEN_NAMES = characterConfig.getString("ForbiddenNames", "").split(",");
|
||||
BUFFS_MAX_AMOUNT = characterConfig.getByte("MaxBuffAmount", (byte) 24);
|
||||
DEBUFFS_MAX_AMOUNT = characterConfig.getByte("MaxDebuffAmount", (byte) 6);
|
||||
ENABLE_MODIFY_SKILL_DURATION = characterConfig.getBoolean("EnableModifySkillDuration", false);
|
||||
|
@ -98,6 +98,18 @@ public class CharacterCreate extends GameClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.FORBIDDEN_NAMES.length > 0)
|
||||
{
|
||||
for (String st : Config.FORBIDDEN_NAMES)
|
||||
{
|
||||
if (_name.toLowerCase().contains(st.toLowerCase()))
|
||||
{
|
||||
getClient().sendPacket(new CharCreateFail(CharCreateFail.REASON_INCORRECT_NAME));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PlayerInstance newChar = null;
|
||||
PlayerTemplate template = null;
|
||||
|
||||
|
@ -25,6 +25,7 @@ public class CharCreateFail extends GameServerPacket
|
||||
public static final int REASON_TOO_MANY_CHARACTERS = 0x01;
|
||||
public static final int REASON_NAME_ALREADY_EXISTS = 0x02;
|
||||
public static final int REASON_16_ENG_CHARS = 0x03;
|
||||
public static final int REASON_INCORRECT_NAME = 0x04;
|
||||
|
||||
private final int _error;
|
||||
|
||||
|
Reference in New Issue
Block a user