RequestPartyMatchConfig.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. /**
  17. * This class ...
  18. *
  19. * @version $Revision: 1.1.4.2 $ $Date: 2005/03/27 15:29:30 $
  20. */
  21. public final class RequestPartyMatchConfig extends L2GameClientPacket
  22. {
  23. private static final String _C__6F_REQUESTPARTYMATCHCONFIG = "[C] 6F RequestPartyMatchConfig";
  24. //private static Logger _log = Logger.getLogger(RequestPartyMatchConfig.class.getName());
  25. private int _automaticRegistration;
  26. private int _showLevel;
  27. private int _showClass;
  28. private String _memo;
  29. @Override
  30. protected void readImpl()
  31. {
  32. _automaticRegistration = readD();
  33. _showLevel = readD();
  34. _showClass = readD();
  35. /*
  36. * TODO: Check if this this part of the packet has been
  37. * removed by latest versions.
  38. *
  39. try
  40. {
  41. _memo = readS();
  42. }
  43. catch (BufferUnderflowException e)
  44. {
  45. _memo = "";
  46. _log.warning("Memo field non existant in packet. Notify devs.");
  47. e.printStackTrace();
  48. }*/
  49. }
  50. @Override
  51. protected void runImpl()
  52. {
  53. // TODO: this packet is currently for creating a new party room
  54. if (getClient().getActiveChar() == null)
  55. return;
  56. getClient().getActiveChar().setPartyMatchingAutomaticRegistration(_automaticRegistration == 1);
  57. getClient().getActiveChar().setPartyMatchingShowLevel(_showLevel == 1);
  58. getClient().getActiveChar().setPartyMatchingShowClass(_showClass == 1);
  59. getClient().getActiveChar().setPartyMatchingMemo(_memo);
  60. }
  61. /* (non-Javadoc)
  62. * @see com.l2jserver.gameserver.clientpackets.ClientBasePacket#getType()
  63. */
  64. @Override
  65. public String getType()
  66. {
  67. return _C__6F_REQUESTPARTYMATCHCONFIG;
  68. }
  69. }