Да вот он
Код:
public class RequestCharacterNameCreatable extends L2GameClientPacket
{
protected String _name;
@Override
protected void readImpl()
{
_name = readS();
}
@Override
protected void runImpl()
{
if (_name.length() < 1 || _name.length() > 16)
{
sendPacket(new ExIsCharNameCreatable(ExIsCharNameCreatable.CHARS_16));
return;
}
if (!Util.isAlphaNumeric(_name) || !isValidName(_name))
{
sendPacket(new ExIsCharNameCreatable(ExIsCharNameCreatable.INCORRECT_NAME));
return;
}
synchronized (CharNameTable.getInstance())
{
if (CharNameTable.getInstance().accountCharNumber(getClient().getLoginName()) >= Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT && Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT != 0)
{
sendPacket(new ExIsCharNameCreatable(ExIsCharNameCreatable.TOO_MANY_CHARACTERS));
return;
}
else if (CharNameTable.getInstance().doesCharNameExist(_name))
{
sendPacket(new ExIsCharNameCreatable(ExIsCharNameCreatable.NAME_ALREADY_EXISTS));
return;
}
}
sendPacket(new ExIsCharNameCreatable(ExIsCharNameCreatable.OK));
}
private boolean isValidName(String text)
{
boolean result = true;
String test = text;
Pattern pattern;
try
{
pattern = Pattern.compile(Config.CNAME_TEMPLATE);
}
catch (PatternSyntaxException e) // case of illegal pattern
{
pattern = Pattern.compile(".*");
}
Matcher regexp = pattern.matcher(test);
if (!regexp.matches())
result = false;
return result;
}
@Override
public String getType()
{
return "[C] B0 RequestCharacterNameCreatable";
}
}
Вот мой ExIsCharNameCreatable
Код:
public class ExIsCharNameCreatable extends L2GameServerPacket
{
public static final int OK = -1; // "Your character creation has failed."
public static final int FAILED = 0; // "Your character creation has failed."
public static final int TOO_MANY_CHARACTERS = 1; // "You cannot create another character. Please delete the existing character and try again."
public static final int NAME_ALREADY_EXISTS = 2; // "This name already exists."
public static final int CHARS_16 = 3; // "Your title cannot exceed 16 characters in length. Please try again."
public static final int INCORRECT_NAME = 4; // "Incorrect name. Please try again."
public static final int CREATE_NOT_ALLOWED = 5; // "Characters cannot be created from this server."
public static final int CHOOSE_ANOTHER_SVR = 6; // "Unable to create character. You are unable to create a new character on the selected server. A restriction is in place which restricts users from creating characters on different servers where no previous character exists. Please choose another server."
protected int _code;
public ExIsCharNameCreatable(int code)
{
_code = code;
}
public void runImpl()
{
}
@Override
protected final void writeImpl()
{
writeC(0xfe);
writeH(0x10f);
writeD(_code);
}
@Override
public String getType()
{
return "[S] 10F ExIsCharNameCreatable";
}
}
Может в них чего то накосячил??