DlgAnswer.java 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.network.SystemMessageId;
  19. /**
  20. * @author Dezmond_snz
  21. * Format: cddd
  22. */
  23. public final class DlgAnswer extends L2GameClientPacket
  24. {
  25. private static final String _C__C5_DLGANSWER = "[C] C5 DlgAnswer";
  26. private static Logger _log = Logger.getLogger(DlgAnswer.class.getName());
  27. private int _messageId;
  28. private int _answer;
  29. private int _unk;
  30. @Override
  31. protected void readImpl()
  32. {
  33. _messageId = readD();
  34. _answer = readD();
  35. _unk = readD();
  36. }
  37. @Override
  38. public void runImpl()
  39. {
  40. if (Config.DEBUG)
  41. _log.fine(getType()+": Answer accepted. Message ID "+_messageId+", answer "+_answer+", unknown field "+_unk);
  42. if (_messageId == SystemMessageId.RESSURECTION_REQUEST.getId())
  43. getClient().getActiveChar().reviveAnswer(_answer);
  44. else if (_messageId == SystemMessageId.S1.getId() && Config.L2JMOD_ALLOW_WEDDING)
  45. getClient().getActiveChar().EngageAnswer(_answer);
  46. }
  47. @Override
  48. public String getType()
  49. {
  50. return _C__C5_DLGANSWER;
  51. }
  52. }