RequestPledgeCrest.java 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.Logger;
  17. import com.l2jserver.Config;
  18. import com.l2jserver.gameserver.cache.CrestCache;
  19. import com.l2jserver.gameserver.network.serverpackets.PledgeCrest;
  20. /**
  21. * This class ...
  22. *
  23. * @version $Revision: 1.4.4.4 $ $Date: 2005/03/27 15:29:30 $
  24. */
  25. public final class RequestPledgeCrest extends L2GameClientPacket
  26. {
  27. private static Logger _log = Logger.getLogger(RequestPledgeCrest.class.getName());
  28. private static final String _C__68_REQUESTPLEDGECREST = "[C] 68 RequestPledgeCrest";
  29. private int _crestId;
  30. @Override
  31. protected void readImpl()
  32. {
  33. _crestId = readD();
  34. }
  35. @Override
  36. protected void runImpl()
  37. {
  38. if (_crestId == 0)
  39. return;
  40. if (Config.DEBUG) _log.fine("crestid " + _crestId + " requested");
  41. byte[] data = CrestCache.getInstance().getPledgeCrest(_crestId);
  42. if (data != null)
  43. {
  44. PledgeCrest pc = new PledgeCrest(_crestId, data);
  45. sendPacket(pc);
  46. }
  47. else
  48. {
  49. if (Config.DEBUG) _log.fine("crest is missing:" + _crestId);
  50. }
  51. }
  52. /* (non-Javadoc)
  53. * @see com.l2jserver.gameserver.clientpackets.ClientBasePacket#getType()
  54. */
  55. @Override
  56. public String getType()
  57. {
  58. return _C__68_REQUESTPLEDGECREST;
  59. }
  60. @Override
  61. protected boolean triggersOnActionRequest()
  62. {
  63. return false;
  64. }
  65. }