Addition of ForbiddenNames configuration.
This commit is contained in:
@ -228,6 +228,11 @@ CancelLesserEffect = True
|
|||||||
# Keep the effects buffs and debuff when you exit the game
|
# Keep the effects buffs and debuff when you exit the game
|
||||||
StoreSkillCooltime = True
|
StoreSkillCooltime = True
|
||||||
|
|
||||||
|
# Character name restriction
|
||||||
|
# Disallow characters to have a name which contains the words.
|
||||||
|
# Split them with ",". Example: announcements,announce...
|
||||||
|
ForbiddenNames = annou,ammou,amnou,anmou,anou,amou
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Buffs
|
# Buffs
|
||||||
|
@ -1077,6 +1077,7 @@ public class Config
|
|||||||
public static int DEATH_PENALTY_CHANCE;
|
public static int DEATH_PENALTY_CHANCE;
|
||||||
public static boolean EFFECT_CANCELING;
|
public static boolean EFFECT_CANCELING;
|
||||||
public static boolean STORE_SKILL_COOLTIME;
|
public static boolean STORE_SKILL_COOLTIME;
|
||||||
|
public static String[] FORBIDDEN_NAMES;
|
||||||
public static byte BUFFS_MAX_AMOUNT;
|
public static byte BUFFS_MAX_AMOUNT;
|
||||||
public static byte DEBUFFS_MAX_AMOUNT;
|
public static byte DEBUFFS_MAX_AMOUNT;
|
||||||
public static boolean ENABLE_MODIFY_SKILL_DURATION;
|
public static boolean ENABLE_MODIFY_SKILL_DURATION;
|
||||||
@ -2776,6 +2777,7 @@ public class Config
|
|||||||
DEATH_PENALTY_CHANCE = characterConfig.getInt("DeathPenaltyChance", 20);
|
DEATH_PENALTY_CHANCE = characterConfig.getInt("DeathPenaltyChance", 20);
|
||||||
EFFECT_CANCELING = characterConfig.getBoolean("CancelLesserEffect", true);
|
EFFECT_CANCELING = characterConfig.getBoolean("CancelLesserEffect", true);
|
||||||
STORE_SKILL_COOLTIME = characterConfig.getBoolean("StoreSkillCooltime", true);
|
STORE_SKILL_COOLTIME = characterConfig.getBoolean("StoreSkillCooltime", true);
|
||||||
|
FORBIDDEN_NAMES = characterConfig.getString("ForbiddenNames", "").split(",");
|
||||||
BUFFS_MAX_AMOUNT = characterConfig.getByte("MaxBuffAmount", (byte) 24);
|
BUFFS_MAX_AMOUNT = characterConfig.getByte("MaxBuffAmount", (byte) 24);
|
||||||
DEBUFFS_MAX_AMOUNT = characterConfig.getByte("MaxDebuffAmount", (byte) 6);
|
DEBUFFS_MAX_AMOUNT = characterConfig.getByte("MaxDebuffAmount", (byte) 6);
|
||||||
ENABLE_MODIFY_SKILL_DURATION = characterConfig.getBoolean("EnableModifySkillDuration", false);
|
ENABLE_MODIFY_SKILL_DURATION = characterConfig.getBoolean("EnableModifySkillDuration", false);
|
||||||
|
@ -98,6 +98,18 @@ public class CharacterCreate extends GameClientPacket
|
|||||||
return;
|
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;
|
PlayerInstance newChar = null;
|
||||||
PlayerTemplate template = 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_TOO_MANY_CHARACTERS = 0x01;
|
||||||
public static final int REASON_NAME_ALREADY_EXISTS = 0x02;
|
public static final int REASON_NAME_ALREADY_EXISTS = 0x02;
|
||||||
public static final int REASON_16_ENG_CHARS = 0x03;
|
public static final int REASON_16_ENG_CHARS = 0x03;
|
||||||
|
public static final int REASON_INCORRECT_NAME = 0x04;
|
||||||
|
|
||||||
private final int _error;
|
private final int _error;
|
||||||
|
|
||||||
|
@ -231,6 +231,11 @@ CancelLesserEffect = True
|
|||||||
# Keep the effects buffs and debuff when you exit the game
|
# Keep the effects buffs and debuff when you exit the game
|
||||||
StoreSkillCooltime = True
|
StoreSkillCooltime = True
|
||||||
|
|
||||||
|
# Character name restriction
|
||||||
|
# Disallow characters to have a name which contains the words.
|
||||||
|
# Split them with ",". Example: announcements,announce...
|
||||||
|
ForbiddenNames = annou,ammou,amnou,anmou,anou,amou
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Buffs
|
# Buffs
|
||||||
|
@ -1112,6 +1112,7 @@ public class Config
|
|||||||
public static int DEATH_PENALTY_CHANCE;
|
public static int DEATH_PENALTY_CHANCE;
|
||||||
public static boolean EFFECT_CANCELING;
|
public static boolean EFFECT_CANCELING;
|
||||||
public static boolean STORE_SKILL_COOLTIME;
|
public static boolean STORE_SKILL_COOLTIME;
|
||||||
|
public static String[] FORBIDDEN_NAMES;
|
||||||
public static byte BUFFS_MAX_AMOUNT;
|
public static byte BUFFS_MAX_AMOUNT;
|
||||||
public static byte DEBUFFS_MAX_AMOUNT;
|
public static byte DEBUFFS_MAX_AMOUNT;
|
||||||
public static boolean ENABLE_MODIFY_SKILL_DURATION;
|
public static boolean ENABLE_MODIFY_SKILL_DURATION;
|
||||||
@ -2842,6 +2843,7 @@ public class Config
|
|||||||
DEATH_PENALTY_CHANCE = characterConfig.getInt("DeathPenaltyChance", 20);
|
DEATH_PENALTY_CHANCE = characterConfig.getInt("DeathPenaltyChance", 20);
|
||||||
EFFECT_CANCELING = characterConfig.getBoolean("CancelLesserEffect", true);
|
EFFECT_CANCELING = characterConfig.getBoolean("CancelLesserEffect", true);
|
||||||
STORE_SKILL_COOLTIME = characterConfig.getBoolean("StoreSkillCooltime", true);
|
STORE_SKILL_COOLTIME = characterConfig.getBoolean("StoreSkillCooltime", true);
|
||||||
|
FORBIDDEN_NAMES = characterConfig.getString("ForbiddenNames", "").split(",");
|
||||||
BUFFS_MAX_AMOUNT = characterConfig.getByte("MaxBuffAmount", (byte) 24);
|
BUFFS_MAX_AMOUNT = characterConfig.getByte("MaxBuffAmount", (byte) 24);
|
||||||
DEBUFFS_MAX_AMOUNT = characterConfig.getByte("MaxDebuffAmount", (byte) 6);
|
DEBUFFS_MAX_AMOUNT = characterConfig.getByte("MaxDebuffAmount", (byte) 6);
|
||||||
ENABLE_MODIFY_SKILL_DURATION = characterConfig.getBoolean("EnableModifySkillDuration", false);
|
ENABLE_MODIFY_SKILL_DURATION = characterConfig.getBoolean("EnableModifySkillDuration", false);
|
||||||
|
@ -98,6 +98,18 @@ public class CharacterCreate extends GameClientPacket
|
|||||||
return;
|
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;
|
PlayerInstance newChar = null;
|
||||||
PlayerTemplate template = 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_TOO_MANY_CHARACTERS = 0x01;
|
||||||
public static final int REASON_NAME_ALREADY_EXISTS = 0x02;
|
public static final int REASON_NAME_ALREADY_EXISTS = 0x02;
|
||||||
public static final int REASON_16_ENG_CHARS = 0x03;
|
public static final int REASON_16_ENG_CHARS = 0x03;
|
||||||
|
public static final int REASON_INCORRECT_NAME = 0x04;
|
||||||
|
|
||||||
private final int _error;
|
private final int _error;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user