//we do all actions before adding member to a list, this speeds things up a little
pplayer.add(new PartySmallWindowAll(this, player));
pplayer.add(new SystemMessage(SystemMessage.YOU_HAVE_JOINED_S1S_PARTY).addString(leader.getName()));
pmember_proto.add(new SystemMessage(SystemMessage.S1_HAS_JOINED_THE_PARTY).addString(player.getName()));
pmember_proto.add(new PartySmallWindowAdd(player));
pmember_proto.add(new PartySpelled(player, true));
if((player_pet = player.getPet()) != null)
{
pmember_proto.add(new ExPartyPetWindowAdd(player_pet));
pmember_proto.add(new PartySpelled(player_pet, true));
}
for(Long storedId : members_list)
{
if((member = L2ObjectsStorage.getAsPlayer(storedId)) != null && member != player)
{
pmember = new GArray<L2GameServerPacket>();
pmember.addAll(pmember_proto);
pmember.addAll(RelationChanged.update(member, player, member));
member.sendPackets(pmember);
pplayer.add(new PartySpelled(member, true));
if((member_pet = member.getPet()) != null)
{
pplayer.add(new PartySpelled(member_pet, true));
}
pplayer.addAll(RelationChanged.update(player, member, player)); //FIXME
}
}
// Если партия уже в СС, то вновь прибывшем посылаем пакет открытия окна СС