Пример #1
0
 protected virtual void OnMemberRemoved(Character groupMember, bool kicked)
 {
     if (kicked)
     {
         PartyHandler.SendPartyKickedByMessage(groupMember.Client, this, this.Leader);
     }
     else
     {
         groupMember.Client.Send(new PartyLeaveMessage((uint)this.Id));
     }
     this.ForEach(delegate(Character entry)
     {
         PartyHandler.SendPartyMemberRemoveMessage(entry.Client, this, groupMember);
     });
     Party.MemberRemovedHandler memberRemoved = this.MemberRemoved;
     this.UnBindEvents(groupMember);
     if (memberRemoved != null)
     {
         memberRemoved(this, groupMember, kicked);
     }
 }
Пример #2
0
        protected virtual void OnMemberRemoved(Character groupMember, bool kicked)
        {
            m_clients.Remove(groupMember.Client);

            GroupLevelSum    -= groupMember.Level;
            GroupLevelAverage = MembersCount > 0 ? GroupLevelSum / MembersCount : 0;

            if (kicked)
            {
                PartyHandler.SendPartyKickedByMessage(groupMember.Client, this, Leader);
            }
            else
            {
                groupMember.Client.Send(new PartyLeaveMessage(Id));
            }

            PartyHandler.SendPartyMemberRemoveMessage(Clients, this, groupMember);
            var handler = MemberRemoved;

            UnBindEvents(groupMember);

            handler?.Invoke(this, groupMember, kicked);
        }