RequestDismissPartyRoom.java 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. /**
  20. * @author Gnacik
  21. *
  22. */
  23. public class RequestDismissPartyRoom extends L2GameClientPacket
  24. {
  25. private static final String _C__D0_0A_REQUESTDISMISSPARTYROOM = "[C] D0:0A RequestDismissPartyRoom";
  26. private int _roomid;
  27. @SuppressWarnings("unused")
  28. private int _data2;
  29. @Override
  30. protected void readImpl()
  31. {
  32. _roomid = readD();
  33. _data2 = readD();
  34. }
  35. @Override
  36. protected void runImpl()
  37. {
  38. final L2PcInstance _activeChar = getClient().getActiveChar();
  39. if (_activeChar == null)
  40. return;
  41. PartyMatchRoom _room = PartyMatchRoomList.getInstance().getRoom(_roomid);
  42. if (_room == null)
  43. return;
  44. PartyMatchRoomList.getInstance().deleteRoom(_roomid);
  45. }
  46. @Override
  47. public String getType()
  48. {
  49. return _C__D0_0A_REQUESTDISMISSPARTYROOM;
  50. }
  51. }