Package l2p.gameserver.clientpackets

Source Code of l2p.gameserver.clientpackets.RequestWithdrawPartyRoom

package l2p.gameserver.clientpackets;

import l2p.gameserver.instancemanager.PartyRoomManager;
import l2p.gameserver.model.L2Player;
import l2p.gameserver.model.PartyRoom;

/**
* Format (ch) dd
*/
public class RequestWithdrawPartyRoom extends L2GameClientPacket
{
  @SuppressWarnings("unused")
  private int _roomId, _data2;

  @Override
  public void readImpl()
  {
    _roomId = readD(); //room id
    _data2 = readD(); //unknown
  }

  @Override
  public void runImpl()
  {
    L2Player activeChar = getClient().getActiveChar();
    if(activeChar == null)
    {
      return;
    }
    //_log.info("RequestWithdrawPartyRoom from char: " + activeChar.getName());
    //_log.info("Data received: d:" + _roomId + " d:" + _data2);
    PartyRoom room = PartyRoomManager.getInstance().getRoom(_roomId);
    if(room.getLeader() == null || room.getLeader().equals(activeChar))
    {
      PartyRoomManager.getInstance().removeRoom(_roomId);
    }
    else
    {
      PartyRoomManager.getInstance().getRoom(_roomId).removeMember(activeChar, false);
    }
  }
}
TOP

Related Classes of l2p.gameserver.clientpackets.RequestWithdrawPartyRoom

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.