ExChangePostState.java 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.serverpackets;
  16. /**
  17. * @author Migi
  18. */
  19. public class ExChangePostState extends L2GameServerPacket
  20. {
  21. private static final String _S__FE_B3_EXCHANGEPOSTSTATE = "[S] B3 ExChangePostState";
  22. private boolean _receivedBoard;
  23. private int[] _changedMsgIds;
  24. private int _changeId;
  25. public ExChangePostState(boolean receivedBoard, int[] changedMsgIds, int changeId)
  26. {
  27. _receivedBoard = receivedBoard;
  28. _changedMsgIds = changedMsgIds;
  29. _changeId = changeId;
  30. }
  31. public ExChangePostState(boolean receivedBoard, int changedMsgId, int changeId)
  32. {
  33. _receivedBoard = receivedBoard;
  34. _changedMsgIds = new int[]{changedMsgId};
  35. _changeId = changeId;
  36. }
  37. /* (non-Javadoc)
  38. * @see com.l2jserver.gameserver.serverpackets.ServerBasePacket#writeImpl()
  39. */
  40. @Override
  41. protected void writeImpl()
  42. {
  43. writeC(0xfe);
  44. writeH(0xb3);
  45. writeD(_receivedBoard ? 1 : 0);
  46. writeD(_changedMsgIds.length);
  47. for (int postId : _changedMsgIds)
  48. {
  49. writeD(postId); // postId
  50. writeD(_changeId); // state
  51. }
  52. }
  53. /* (non-Javadoc)
  54. * @see com.l2jserver.gameserver.BasePacket#getType()
  55. */
  56. @Override
  57. public String getType()
  58. {
  59. return _S__FE_B3_EXCHANGEPOSTSTATE;
  60. }
  61. }