Package l2p.gameserver.clientpackets

Source Code of l2p.gameserver.clientpackets.RequestSiegeAttackerList

package l2p.gameserver.clientpackets;

import l2p.gameserver.instancemanager.CastleManager;
import l2p.gameserver.instancemanager.ClanHallManager;
import l2p.gameserver.instancemanager.FortressManager;
import l2p.gameserver.model.entity.residence.Residence;
import l2p.gameserver.serverpackets.SiegeAttackerList;

public class RequestSiegeAttackerList extends L2GameClientPacket
{
  // format: cd
  private int _unitId;

  @Override
  public void readImpl()
  {
    _unitId = readD();
  }

  @Override
  public void runImpl()
  {
    Residence unit = CastleManager.getInstance().getCastleByIndex(_unitId);
    if(unit == null)
    {
      unit = FortressManager.getInstance().getFortressByIndex(_unitId);
    }
    if(unit == null)
    {
      unit = ClanHallManager.getInstance().getClanHall(_unitId);
    }
    if(unit != null)
    {
      sendPacket(new SiegeAttackerList(unit));
    }
  }
}
TOP

Related Classes of l2p.gameserver.clientpackets.RequestSiegeAttackerList

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.