RequestPledgeInfo.java 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 com.l2jserver.gameserver.network.clientpackets;
  16. import java.util.logging.Level;
  17. import java.util.logging.Logger;
  18. import com.l2jserver.Config;
  19. import com.l2jserver.gameserver.datatables.ClanTable;
  20. import com.l2jserver.gameserver.model.L2Clan;
  21. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  22. import com.l2jserver.gameserver.network.serverpackets.PledgeInfo;
  23. /**
  24. * This class ...
  25. *
  26. * @version $Revision: 1.5.4.3 $ $Date: 2005/03/27 15:29:30 $
  27. */
  28. public final class RequestPledgeInfo extends L2GameClientPacket
  29. {
  30. private static final String _C__66_REQUESTPLEDGEINFO = "[C] 66 RequestPledgeInfo";
  31. private static Logger _log = Logger.getLogger(RequestPledgeInfo.class.getName());
  32. private int _clanId;
  33. @Override
  34. protected void readImpl()
  35. {
  36. _clanId = readD();
  37. }
  38. @Override
  39. protected void runImpl()
  40. {
  41. if (Config.DEBUG)
  42. _log.log(Level.FINE, "Info for clan " + _clanId + " requested");
  43. L2PcInstance activeChar = getClient().getActiveChar();
  44. if (activeChar == null)
  45. return;
  46. L2Clan clan = ClanTable.getInstance().getClan(_clanId);
  47. if (clan == null)
  48. {
  49. if (Config.DEBUG)
  50. _log.warning("Clan data for clanId " + _clanId + " is missing for player "+activeChar.getName());
  51. return; // we have no clan data ?!? should not happen
  52. }
  53. PledgeInfo pc = new PledgeInfo(clan);
  54. activeChar.sendPacket(pc);
  55. }
  56. /*
  57. * (non-Javadoc)
  58. *
  59. * @see com.l2jserver.gameserver.clientpackets.ClientBasePacket#getType()
  60. */
  61. @Override
  62. public String getType()
  63. {
  64. return _C__66_REQUESTPLEDGEINFO;
  65. }
  66. @Override
  67. protected boolean triggersOnActionRequest()
  68. {
  69. return false;
  70. }
  71. }