Package l2p.gameserver.model

Examples of l2p.gameserver.model.CharSelectInfoPackage


        lastUsed = i;
      }
    }
    for(int i = 0; i < size; i++)
    {
      CharSelectInfoPackage charInfoPackage = _characterPackages[i];
      writeS(charInfoPackage.getName());
      writeD(charInfoPackage.getCharId()); // ?
      writeS(_loginName);
      writeD(_sessionId);
      writeD(charInfoPackage.getClanId());
      writeD(0x00); // ??
      writeD(charInfoPackage.getSex());
      writeD(charInfoPackage.getRace());
      writeD(charInfoPackage.getClassId());
      writeD(0x01); // active ??
      writeD(charInfoPackage.getX());
      writeD(charInfoPackage.getY());
      writeD(charInfoPackage.getZ());
      writeF(charInfoPackage.getCurrentHp());
      writeF(charInfoPackage.getCurrentMp());
      writeD(charInfoPackage.getSp());
      writeQ(charInfoPackage.getExp());
      writeD(charInfoPackage.getLevel());
      writeD(charInfoPackage.getKarma());
      writeD(charInfoPackage.getPk());
      writeD(charInfoPackage.getPvP());
      writeD(0x00);
      writeD(0x00);
      writeD(0x00);
      writeD(0x00);
      writeD(0x00);
      writeD(0x00);
      writeD(0x00);
      for(byte PAPERDOLL_ID : UserInfo.PAPERDOLL_ORDER)
      {
        writeD(charInfoPackage.getPaperdollItemId(PAPERDOLL_ID));
      }
      writeD(charInfoPackage.getHairStyle());
      writeD(charInfoPackage.getHairColor());
      writeD(charInfoPackage.getFace());
      writeF(charInfoPackage.getMaxHp()); // hp max
      writeF(charInfoPackage.getMaxMp()); // mp max
      writeD(charInfoPackage.getAccessLevel() > -100 ? charInfoPackage.getDeleteTimer() : -1);
      writeD(charInfoPackage.getClassId());
      writeD(i == lastUsed ? 1 : 0);
      writeC(Math.min(charInfoPackage.getEnchantEffect(), 127));
      writeD(0x00); // TODO AugmentationId
      writeD(0x00); // TODO TransformationId
    }
  }
View Full Code Here


    }
  }

  public static CharSelectInfoPackage[] loadCharacterSelectInfo(String loginName)
  {
    CharSelectInfoPackage charInfopackage;
    GArray<CharSelectInfoPackage> characterList = new GArray<CharSelectInfoPackage>();
    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    ResultSet pl_rset = null;
    try
View Full Code Here

    return characterList.toArray(new CharSelectInfoPackage[characterList.size()]);
  }

  private static CharSelectInfoPackage restoreChar(ResultSet chardata, ResultSet charclass)
  {
    CharSelectInfoPackage charInfopackage = null;
    try
    {
      int objectId = chardata.getInt("obj_Id");
      int classid = charclass.getInt("class_id");
      boolean female = chardata.getInt("sex") == 1;
      L2PlayerTemplate templ = CharTemplateTable.getInstance().getTemplate(classid, female);
      if(templ == null)
      {
        _log.log(Level.WARNING, "restoreChar fail | templ == null | objectId: " + objectId + " | classid: " + classid + " | female: " + female);
        return null;
      }
      String name = chardata.getString("char_name");
      charInfopackage = new CharSelectInfoPackage(objectId, name);
      charInfopackage.setLevel(charclass.getInt("level"));
      charInfopackage.setMaxHp(charclass.getInt("maxHp"));
      charInfopackage.setCurrentHp(charclass.getDouble("curHp"));
      charInfopackage.setMaxMp(charclass.getInt("maxMp"));
      charInfopackage.setCurrentMp(charclass.getDouble("curMp"));
      charInfopackage.setX(chardata.getInt("x"));
      charInfopackage.setY(chardata.getInt("y"));
      charInfopackage.setZ(chardata.getInt("z"));
      charInfopackage.setPk(chardata.getInt("pkkills"));
      charInfopackage.setPvP(chardata.getInt("pvpkills"));
      charInfopackage.setFace(chardata.getInt("face"));
      charInfopackage.setHairStyle(chardata.getInt("hairstyle"));
      charInfopackage.setHairColor(chardata.getInt("haircolor"));
      charInfopackage.setSex(female ? 1 : 0);
      charInfopackage.setExp(charclass.getLong("exp"));
      charInfopackage.setSp(charclass.getInt("sp"));
      charInfopackage.setClanId(chardata.getInt("clanid"));
      charInfopackage.setKarma(chardata.getInt("karma"));
      charInfopackage.setRace(templ.race.ordinal());
      charInfopackage.setClassId(classid);
      long deletetime = chardata.getLong("deletetime");
      int deletedays = 0;
      if(Config.DELETE_DAYS > 0)
      {
        if(deletetime > 0)
        {
          deletetime = (int) (System.currentTimeMillis() / 1000 - deletetime);
          deletedays = (int) (deletetime / 3600 / 24);
          if(deletedays >= Config.DELETE_DAYS)
          {
            PlayerManager.deleteFromClan(objectId, charInfopackage.getClanId());
            PlayerManager.deleteCharByObjId(objectId);
            return null;
          }
          deletetime = Config.DELETE_DAYS * 3600 * 24 - deletetime;
        }
        else
        {
          deletetime = 0;
        }
      }
      charInfopackage.setDeleteTimer((int) deletetime);
      charInfopackage.setLastAccess(chardata.getLong("lastAccess") * 1000L);
      charInfopackage.setAccessLevel(chardata.getInt("accesslevel"));
      if(charInfopackage.getAccessLevel() < 0 && !AutoBan.isBanned(objectId))
      {
        charInfopackage.setAccessLevel(0);
      }
    }
    catch(Exception e)
    {
      _log.log(Level.INFO, "", e);
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.CharSelectInfoPackage

Copyright © 2018 www.massapicom. 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.