Exemple #1
0
		public PvPProfileHistoryEntry EnsureStatistics(PlayerMobile pm, bool replace)
		{
			PvPProfileHistoryEntry entry;

			if (!Statistics.TryGetValue(pm, out entry))
			{
				Statistics.Add(pm, entry = new PvPProfileHistoryEntry(AutoPvP.CurrentSeason.Number));
			}
			else if (entry == null || replace)
			{
				Statistics[pm] = entry = new PvPProfileHistoryEntry(AutoPvP.CurrentSeason.Number);
			}

			if (!StatisticsCache.ContainsKey(pm))
			{
				StatisticsCache.Add(pm, entry);
			}
			else
			{
				StatisticsCache[pm] = entry;
			}

			return entry;
		}
Exemple #2
0
		protected virtual void OnTransferStatistics(
			PlayerMobile pm,
			PvPProfileHistoryEntry profileStats,
			PvPProfileHistoryEntry battleStats)
		{
			if (!Ranked || profileStats == null || battleStats == null)
			{
				return;
			}

			profileStats.Battles += battleStats.Battles;
			profileStats.Wins += battleStats.Wins;
			profileStats.Losses += battleStats.Losses;
			profileStats.Kills += battleStats.Kills;
			profileStats.Deaths += battleStats.Deaths;
			profileStats.Resurrections += battleStats.Resurrections;
			profileStats.DamageTaken += battleStats.DamageTaken;
			profileStats.DamageDone += battleStats.DamageDone;
			profileStats.HealingTaken += battleStats.HealingTaken;
			profileStats.HealingDone += battleStats.HealingDone;

			foreach (var kvp in battleStats.MiscStats)
			{
				profileStats[kvp.Key] += kvp.Value;
			}
		}