Esempio n. 1
0
        private void Disband(Character disbander) => OnlyWithLeader(disbander.ID, ldr =>
        {
            _log.Debug($"Disbanding party {partyId} by character {disbander.ID}");

            ForAllMembers(m =>
            {
                m.SendPacket(PartyPacket.MemberLeft(m, ldr, this, true, false));
                var c = m.GetCharacter(false);

                if (c != null)
                {
                    c.PartyID = 0;
                }
                else
                {
                    _log.Debug($"Unable to set PartyID to 0 of {m.id}");
                }
            }, -1, false);

            for (var i = 0; i < Constants.MaxPartyMembers; i++)
            {
                members[i] = null;
            }

            leader = null;

            Parties.Remove(partyId);
            var discardedInvites = Invites.Where(x => x.Value.partyId == partyId).Select(x => x.Key).ToArray();
            discardedInvites.ForEach(x => Invites.Remove(x));

            SendPartyDisband();
        });