/// <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) { // null check is only required because we stated in the documentation of this method that memeber is allowed to be null return; } var chr = member.Character; var listInviters = RelationMgr.Instance.GetRelations(chr.EntityId.Low, CharacterRelationType.GroupInvite).ToList(); foreach (GroupInviteRelation inviteRelation in listInviters) { RelationMgr.Instance.RemoveRelation(inviteRelation); } var group = member.Group; member.LeaveGroup(); /*member.Position = member.Character.Position; * member.Map = member.Character.Map; * member.Character.GroupUpdateFlags |= GroupUpdateFlags.Status; * member.Character = null; * * OfflineChars.Add(chr.EntityId.Low, member);*/ group.SendUpdate(); }
/// <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(); }