Examples of CharCreateFail


Examples of com.l2client.network.game.ServerPackets.CharCreateFail

        break;
      case 0x0f:
        pa = new CharCreateOk();
        break;
      case 0x10:
        pa = new CharCreateFail();
        break;
      case 0x11:
        pa = new ItemList();
        break;
      case 0x12:
View Full Code Here

Examples of com.l2jfrozen.gameserver.network.serverpackets.CharCreateFail

    if (_name.length() < 3 || _name.length() > 16 || !Util.isAlphaNumeric(_name) || !isValidName(_name))
    {
      if (Config.DEBUG)
        _log.fine("DEBUG "+getType()+": charname: " + _name + " is invalid. creation failed.");

      sendPacket(new CharCreateFail(CharCreateFail.REASON_16_ENG_CHARS));
      return;
    }

    if (Config.DEBUG)
      _log.fine("DEBUG "+getType()+": charname: " + _name + " classId: " + _classId);

    L2PcInstance newChar = null;
    L2PcTemplate template = null;

    // Since checks for duplicate names are done using SQL, lock must be held until data is written to DB as well.
    synchronized (CharNameTable.getInstance())
    {
      if (CharNameTable.getInstance().accountCharNumber(getClient().getAccountName()) >= Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT && Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT != 0)
      {
        if (Config.DEBUG)
          _log.fine("DEBUG "+getType()+": Max number of characters reached. Creation failed.");
       
        sendPacket(new CharCreateFail(CharCreateFail.REASON_TOO_MANY_CHARACTERS));
        return;
      }
      else if (CharNameTable.getInstance().doesCharNameExist(_name))
      {
        if(Config.DEBUG)
          _log.fine("DEBUG "+getType()+": charname: " + _name + " already exists. creation failed.");

        sendPacket(new CharCreateFail(CharCreateFail.REASON_NAME_ALREADY_EXISTS));
        return;
      }else if (CharNameTable.getInstance().ipCharNumber(getClient().getConnection().getInetAddress().getHostName()) >= Config.MAX_CHARACTERS_NUMBER_PER_IP && Config.MAX_CHARACTERS_NUMBER_PER_IP != 0)
      {
        if (Config.DEBUG)
          _log.fine("DEBUG "+getType()+": Max number of characters reached for IP. Creation failed.");
       
        sendPacket(new CharCreateFail(CharCreateFail.REASON_TOO_MANY_CHARACTERS));
        return;
      }

      template = CharTemplateTable.getInstance().getTemplate(_classId);

      if (Config.DEBUG)
        _log.fine("DEBUG "+getType()+": charname: " + _name + " classId: " + _classId + " template: " + template);

      if (template == null || template.classBaseLevel > 1)
      {
        sendPacket(new CharCreateFail(CharCreateFail.REASON_CREATION_FAILED));
        return;
      }

      int objectId = IdFactory.getInstance().getNextId();
      newChar = L2PcInstance.create(objectId, template, getClient().getAccountName(), _name, _hairStyle, _hairColor, _face, _sex != 0);
View Full Code Here

Examples of net.sf.l2j.gameserver.serverpackets.CharCreateFail

  {
        if (CharNameTable.getInstance().accountCharNumber(getClient().getAccountName()) >= Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT && Config.MAX_CHARACTERS_NUMBER_PER_ACCOUNT != 0)
        {
            if (Config.DEBUG)
                _log.fine("Max number of characters reached. Creation failed.");
            CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_TOO_MANY_CHARACTERS);
            sendPacket(ccf);
            return;
        }
        else if (CharNameTable.getInstance().doesCharNameExist(_name))
    {
      if (Config.DEBUG)
        _log.fine("charname: "+ _name + " already exists. creation failed.");
      CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_NAME_ALREADY_EXISTS);
      sendPacket(ccf);
      return;
    }
    else if ((_name.length() < 3) || (_name.length() > 16) || !Util.isAlphaNumeric(_name) || !isValidName(_name))
    {
      if (Config.DEBUG)
        _log.fine("charname: " + _name + " is invalid. creation failed.");
      CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_16_ENG_CHARS);
      sendPacket(ccf);
      return;
    }

    if (Config.DEBUG)
      _log.fine("charname: " + _name + " classId: " + _classId);

    L2PcTemplate template = CharTemplateTable.getInstance().getTemplate(_classId);
    if(template == null || template.classBaseLevel > 1)
    {
      CharCreateFail ccf = new CharCreateFail(CharCreateFail.REASON_CREATION_FAILED);
      sendPacket(ccf);
      return;
    }

    int objectId = IdFactory.getInstance().getNextId();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.