Esempio n. 1
0
        /// <summary>
        /// Cleanup character invitations and group leader, looter change on character logout/disconnect
        /// </summary>
        /// <param name="member">The GroupMember logging out / disconnecting (or null if the corresponding Character is not in a Group)</param>
        internal void OnCharacterLogout(GroupMember member)
        {
            if (member == null)
            {
                return;
            }
            foreach (IBaseRelation relation in Singleton <RelationMgr> .Instance
                     .GetRelations(member.Character.EntityId.Low, CharacterRelationType.GroupInvite).ToList())
            {
                Singleton <RelationMgr> .Instance.RemoveRelation(relation);
            }
            Group group = member.Group;

            member.LeaveGroup();
            group.SendUpdate();
        }
Esempio n. 2
0
        internal void OnCharacterLogin(Character chr)
        {
            GroupMember groupMember;

            if (!OfflineChars.TryGetValue(chr.EntityId.Low, out groupMember))
            {
                return;
            }
            OfflineChars.Remove(chr.EntityId.Low);
            groupMember.Character = chr;
            Group group = groupMember.Group;

            if (group.Leader == null)
            {
                group.Leader = groupMember;
            }
            else
            {
                group.SendUpdate();
            }
            chr.GroupUpdateFlags |= GroupUpdateFlags.Status;
        }