ExManagePartyRoomMember.java 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. import com.l2jserver.gameserver.instancemanager.TownManager;
  17. import com.l2jserver.gameserver.model.PartyMatchRoom;
  18. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  19. /**
  20. * @author Gnacik
  21. *
  22. * Mode :
  23. * 0 - add
  24. * 1 - modify
  25. * 2 - quit
  26. */
  27. public class ExManagePartyRoomMember extends L2GameServerPacket
  28. {
  29. private final L2PcInstance _activeChar;
  30. private final PartyMatchRoom _room;
  31. private final int _mode;
  32. public ExManagePartyRoomMember(L2PcInstance player, PartyMatchRoom room, int mode)
  33. {
  34. _activeChar = player;
  35. _room = room;
  36. _mode = mode;
  37. }
  38. @Override
  39. protected void writeImpl()
  40. {
  41. writeC(0xfe);
  42. writeH(0x0A);
  43. writeD(_mode);
  44. writeD(_activeChar.getObjectId());
  45. writeS(_activeChar.getName());
  46. writeD(_activeChar.getActiveClass());
  47. writeD(_activeChar.getLevel());
  48. writeD(TownManager.getClosestLocation(_activeChar));
  49. if (_room.getOwner().equals(_activeChar))
  50. writeD(1);
  51. else
  52. {
  53. if((_room.getOwner().isInParty() && _activeChar.isInParty()) && (_room.getOwner().getParty().getPartyLeaderOID() == _activeChar.getParty().getPartyLeaderOID()))
  54. writeD(2);
  55. else
  56. writeD(0);
  57. }
  58. }
  59. @Override
  60. public String getType()
  61. {
  62. return "[S] FE:0A ExManagePartyRoomMember";
  63. }
  64. }