DlgAnswer.java 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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, _unk;
  29. @Override
  30. protected void readImpl()
  31. {
  32. _messageId = readD();
  33. _answer = readD();
  34. _unk = readD();
  35. }
  36. @Override
  37. public void runImpl()
  38. {
  39. if (Config.DEBUG)
  40. _log.fine(getType()+": Answer acepted. Message ID "+_messageId+", asnwer "+_answer+", unknown field "+_unk);
  41. if (_messageId == SystemMessageId.RESSURECTION_REQUEST.getId())
  42. getClient().getActiveChar().reviveAnswer(_answer);
  43. else if (_messageId==614 && Config.L2JMOD_ALLOW_WEDDING)
  44. getClient().getActiveChar().EngageAnswer(_answer);
  45. }
  46. @Override
  47. public String getType()
  48. {
  49. return _C__C5_DLGANSWER;
  50. }
  51. }