/// <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(); } } }
/// <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); } } }
public Reputation(ReputationRecord record, Faction faction, int defaultValue, ReputationFlags defaultFlags) { this.m_record = record; this.m_record.ReputationIndex = faction.ReputationIndex; this.m_record.Value = defaultValue; this.m_record.Flags = defaultFlags; this.Faction = faction; this.m_standing = Reputation.GetStanding(defaultValue); this.m_record.Save(); }
public Reputation(ReputationRecord record, Faction faction, int defaultValue, ReputationFlags defaultFlags) { m_record = record; m_record.ReputationIndex = faction.ReputationIndex; m_record.Value = defaultValue; m_record.Flags = defaultFlags; Faction = faction; m_standing = GetStanding(defaultValue); m_record.Save(); }
/// <summary> /// Loads an existing Reputation from the given Record. /// </summary> public Reputation(ReputationRecord record, Faction faction) { m_record = record; Faction = faction; m_standing = GetStanding(record.Value); }
/// <summary>Loads an existing Reputation from the given Record.</summary> public Reputation(ReputationRecord record, Faction faction) { this.m_record = record; this.Faction = faction; this.m_standing = Reputation.GetStanding(record.Value); }