RequestPledgeInfo.java 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package net.sf.l2j.gameserver.clientpackets;
  16. import java.util.logging.Logger;
  17. import net.sf.l2j.Config;
  18. import net.sf.l2j.gameserver.datatables.ClanTable;
  19. import net.sf.l2j.gameserver.model.L2Clan;
  20. import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  21. import net.sf.l2j.gameserver.serverpackets.PledgeInfo;
  22. /**
  23. * This class ...
  24. *
  25. * @version $Revision: 1.5.4.3 $ $Date: 2005/03/27 15:29:30 $
  26. */
  27. public final class RequestPledgeInfo extends L2GameClientPacket
  28. {
  29. private static final String _C__66_REQUESTPLEDGEINFO = "[C] 66 RequestPledgeInfo";
  30. private static Logger _log = Logger.getLogger(RequestPledgeInfo.class.getName());
  31. private int _clanId;
  32. @Override
  33. protected void readImpl()
  34. {
  35. _clanId = readD();
  36. }
  37. @Override
  38. protected void runImpl()
  39. {
  40. if (Config.DEBUG)
  41. _log.fine("infos for clan " + _clanId + " requested");
  42. L2PcInstance activeChar = getClient().getActiveChar();
  43. L2Clan clan = ClanTable.getInstance().getClan(_clanId);
  44. if (clan == null)
  45. {
  46. _log.warning("Clan data for clanId " + _clanId + " is missing");
  47. return; // we have no clan data ?!? should not happen
  48. }
  49. PledgeInfo pc = new PledgeInfo(clan);
  50. if (activeChar != null)
  51. {
  52. activeChar.sendPacket(pc);
  53. /*
  54. * if (clan.getClanId() == activeChar.getClanId()) {
  55. * activeChar.sendPacket(new PledgeShowMemberListDeleteAll());
  56. * PledgeShowMemberListAll pm = new PledgeShowMemberListAll(clan,
  57. * activeChar); activeChar.sendPacket(pm); }
  58. */
  59. }
  60. }
  61. /*
  62. * (non-Javadoc)
  63. *
  64. * @see net.sf.l2j.gameserver.clientpackets.ClientBasePacket#getType()
  65. */
  66. @Override
  67. public String getType()
  68. {
  69. return _C__66_REQUESTPLEDGEINFO;
  70. }
  71. }