RequestWithDrawalParty.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. import com.l2jserver.gameserver.model.PartyMatchRoom;
  17. import com.l2jserver.gameserver.model.PartyMatchRoomList;
  18. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  19. import com.l2jserver.gameserver.network.serverpackets.ExClosePartyRoom;
  20. import com.l2jserver.gameserver.network.serverpackets.ExPartyRoomMember;
  21. import com.l2jserver.gameserver.network.serverpackets.PartyMatchDetail;
  22. /**
  23. *
  24. * This class ...
  25. *
  26. * @version $Revision: 1.3.4.2 $ $Date: 2005/03/27 15:29:30 $
  27. */
  28. public final class RequestWithDrawalParty extends L2GameClientPacket
  29. {
  30. private static final String _C__2B_REQUESTWITHDRAWALPARTY = "[C] 2B RequestWithDrawalParty";
  31. //private static Logger _log = Logger.getLogger(RequestWithDrawalParty.class.getName());
  32. @Override
  33. protected void readImpl()
  34. {
  35. //trigger
  36. }
  37. @Override
  38. protected void runImpl()
  39. {
  40. L2PcInstance player = getClient().getActiveChar();
  41. if (player == null)
  42. return;
  43. if (player.isInParty())
  44. {
  45. if (player.getParty().isInDimensionalRift() && !player.getParty().getDimensionalRift().getRevivedAtWaitingRoom().contains(player))
  46. player.sendMessage("You can't exit party when you are in Dimensional Rift.");
  47. else
  48. {
  49. player.getParty().removePartyMember(player);
  50. if(player.isInPartyMatchRoom())
  51. {
  52. PartyMatchRoom _room = PartyMatchRoomList.getInstance().getPlayerRoom(player);
  53. if(_room != null)
  54. {
  55. player.sendPacket(new PartyMatchDetail(player, _room));
  56. player.sendPacket(new ExPartyRoomMember(player, _room, 0));
  57. player.sendPacket(new ExClosePartyRoom());
  58. _room.deleteMember(player);
  59. }
  60. player.setPartyRoom(0);
  61. //player.setPartyMatching(0);
  62. player.broadcastUserInfo();
  63. }
  64. }
  65. }
  66. }
  67. @Override
  68. public String getType()
  69. {
  70. return _C__2B_REQUESTWITHDRAWALPARTY;
  71. }
  72. }