попробуй добавить в L2GamePacketHandler
Добавлено через 1 минуту
Код:
case 0xd0:
if(data.remaining() < 2)
{
handleIncompletePacket(client);
break;
}
int id3 = data.getShort() & 0xffff;
if(id3 == 0x36)
{
msg = new GotoLobby();
}
if(id3 == 0xb0)
{
msg = new RequestCharacterNameCreatable();
}
break;
Добавлено через 1 минуту
Код:
public class RequestCharacterNameCreatable extends L2GameClientPacket
{
private static final String _fld03E6 = "[C] D0:B0 RequestCharacterNameCreatable";
private 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] D0:B0 RequestCharacterNameCreatable";
}
}