예제 #1
0
  public void addMember(L2PcInstance player) {
    if (getMembers().contains(player)) return;

    PartyRoomManager.getInstance().removeFromWaitingList(player);
    broadcastPacket(new ExManagePartyRoomMember(ExManagePartyRoomMember.ADDED, player));
    broadcastPacket(new SystemMessage(SystemMessageId.S1_ENTERED_PARTY_ROOM).addPcName(player));
    updateRoomStatus(false);
    getMembers().add(player);
    player.setPartyRoom(this);
    player.sendPacket(new PartyMatchDetail(this));
    player.sendPacket(new ExPartyRoomMember(this, getMemberCount() == 1));
  }
예제 #2
0
  public void removeMember(L2PcInstance member, boolean oust) {
    // the last member (leader) cannot be removed
    if (getMemberCount() == 1 || !getMembers().remove(member)) return;

    member.setPartyRoom(null);
    member.sendPacket(ExClosePartyRoom.STATIC_PACKET);
    if (oust) member.sendPacket(SystemMessageId.OUSTED_FROM_PARTY_ROOM);
    else member.sendPacket(SystemMessageId.PARTY_ROOM_EXITED);

    SystemMessage sm;
    if (oust) sm = new SystemMessage(SystemMessageId.S1_KICKED_FROM_PARTY_ROOM);
    else sm = new SystemMessage(SystemMessageId.S1_LEFT_PARTY_ROOM);
    sm.addPcName(member);
    broadcastPacket(new ExManagePartyRoomMember(ExManagePartyRoomMember.REMOVED, member));
    broadcastPacket(sm);
    updateRoomStatus(false);
  }
예제 #3
0
 /** Broadcasts PartyRoomInfo and ExPartyRoomMember packets */
 public void updateRoomStatus(boolean playerList) {
   broadcastPacket(new PartyMatchDetail(this));
   if (playerList) broadcastPacket(new ExPartyRoomMember(this, true), new ExPartyRoomMember(this));
 }