Exemplo n.º 1
0
 /// <summary>
 /// This is used to visit a list of members
 /// </summary>
 /// <param name="members">The list of members to visit</param>
 protected virtual void VisitMembers(MemberList members)
 {
     // Visit the members in sorted order
     foreach (Member member in members.OrderBy(m => m.FullName))
     {
         // Don't visit nested types either as they are already visited
         if (!(member is TypeNode) && filter.IsExposedMember(member))
         {
             this.VisitMember(member);
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// This is used to visit a list of members
 /// </summary>
 /// <param name="members">The list of members to visit</param>
 protected virtual void VisitMembers(MemberList members)
 {
     // Visit the members in sorted order
     foreach(Member member in members.OrderBy(m => m.FullName))
     {
         // Don't visit nested types either as they are already visited
         if(!(member is TypeNode) && filter.IsExposedMember(member))
             this.VisitMember(member);
     }
 }
Exemplo n.º 3
0
        public void DeleteMember(ulong guid)
        {
            Player player = ObjMgr.FindPlayer(guid);

            if (GetLeaderGuid() == guid)
            {
                Member oldLeader = null;
                Member newLeader = null;
                foreach (var member in MemberList.OrderBy(p => p.RankId))
                {
                    if (member.CharGuid == guid)
                    {
                        oldLeader = member;
                    }
                    else if (newLeader == null || newLeader.RankId > member.RankId)
                    {
                        newLeader = member;
                    }
                }

                if (newLeader == null)
                {
                    Disband();
                    return;
                }

                SetLeader(newLeader);

                Player newLeaderPlayer = ObjMgr.FindPlayer(newLeader.CharGuid);
                if (newLeaderPlayer != null)
                {
                    newLeaderPlayer.SetGuildRank((uint)GuildDefaultRanks.Master);
                }

                if (oldLeader != null)
                {
                    SendBroadcastEvent(GuildEvents.LeaderChanged, 0, oldLeader.Name, newLeader.Name);
                    SendBroadcastEvent(GuildEvents.Left, guid, oldLeader.Name);
                }
            }
            Member m = GetMember(guid);

            if (m == null)
            {
                return;
            }
            MemberList.Remove(m);

            if (player != null)
            {
                player.SetInGuild(0);
                player.SetGuildRank(0);
                player.SetGuildLevel(0);

                /*
                 * for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i)
                 *  if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i))
                 * if (entry->Level >= GetLevel())
                 *  player->removeSpell(entry->SpellId, false, false);
                 */
            }
            PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.GuildDelMember);

            stmt.AddValue(0, guid);
            DB.Characters.Execute(stmt);
        }