/// <summary>
        /// Loads all Factions that this Character already knows from the DB
        /// </summary>
        public void Load()
        {
            foreach (var record in ReputationRecord.Load(m_owner.Record.Guid))
            {
                var fac = FactionMgr.Get(record.ReputationIndex);
                if (fac != null)
                {
                    if (m_byIndex.ContainsKey(record.ReputationIndex))
                    {
                        log.Warn("Character {0} had Reputation with Faction {1} more than once.", m_owner, record.ReputationIndex);
                    }
                    else
                    {
                        var rep = new Reputation(record, fac);
                        m_byIndex.Add(record.ReputationIndex, rep);
                    }
                }
                else
                {
                    log.Warn("Character {0} has saved Reputation with invalid Faction: {1}", m_owner, record.ReputationIndex);

                    // record.DeleteAndFlush();
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// Loads all Factions that this Character already knows from the DB
 /// </summary>
 public void Load()
 {
     foreach (ReputationRecord record in ReputationRecord.Load(this.m_owner.Record.Guid))
     {
         Faction faction = FactionMgr.Get(record.ReputationIndex);
         if (faction != null)
         {
             if (this.m_byIndex.ContainsKey(record.ReputationIndex))
             {
                 ReputationCollection.log.Warn("Character {0} had Reputation with Faction {1} more than once.",
                                               (object)this.m_owner, (object)record.ReputationIndex);
             }
             else
             {
                 Reputation reputation = new Reputation(record, faction);
                 this.m_byIndex.Add(record.ReputationIndex, reputation);
             }
         }
         else
         {
             ReputationCollection.log.Warn("Character {0} has saved Reputation with invalid Faction: {1}",
                                           (object)this.m_owner, (object)record.ReputationIndex);
         }
     }
 }