1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

fixed broken broadcast events

events don't get out of order when a invalid event line throws exception
handle the stats history update with no change throwing DBConcurrencyException
This commit is contained in:
RaidMax
2018-08-31 22:35:51 -05:00
parent 18aa6e85fc
commit 50b4426cab
11 changed files with 126 additions and 67 deletions

View File

@ -45,7 +45,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
var thirtyDaysAgo = DateTime.UtcNow.AddMonths(-1);
var iqClientRatings = (from rating in context.Set<EFRating>()
#if !DEBUG
#if DEBUG == false
where rating.ActivityAmount >= Plugin.Config.Configuration().TopPlayersMinPlayTime
#endif
where rating.RatingHistory.Client.Level != Player.Permission.Banned
@ -561,9 +561,9 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
}
// update their performance
#if !DEBUG
//#if !DEBUG
if ((DateTime.UtcNow - attackerStats.LastStatHistoryUpdate).TotalMinutes >= 2.5)
#endif
//#endif
{
await UpdateStatHistory(attacker, attackerStats);
attackerStats.LastStatHistoryUpdate = DateTime.UtcNow;
@ -718,7 +718,14 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
ActivityAmount = clientStatsList.Sum(s => s.TimePlayed)
});
await ctx.SaveChangesAsync();
try
{
await ctx.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException e)
{
}
}
}