add penalties for angle info

queue Tell/Say to prevent plugins from throwing exception when server is offlline
fixed CPU usage issue over time
sort penalties by type on webfront
This commit is contained in:
RaidMax
2018-05-03 23:22:10 -05:00
parent f442f251f6
commit 3092a529e9
18 changed files with 775 additions and 548 deletions

View File

@ -98,13 +98,14 @@ namespace SharedLibraryCore.Services
throw new NotImplementedException();
}
public async Task<IList<EFPenalty>> GetRecentPenalties(int count, int offset)
public async Task<IList<EFPenalty>> GetRecentPenalties(int count, int offset, Penalty.PenaltyType showOnly = Penalty.PenaltyType.Any)
{
using (var context = new DatabaseContext())
return await context.Penalties
.AsNoTracking()
.Include(p => p.Offender.CurrentAlias)
.Include(p => p.Punisher.CurrentAlias)
.Where(p => showOnly == Penalty.PenaltyType.Any ? p.Type != Penalty.PenaltyType.Any : p.Type == showOnly)
.Where(p => p.Active)
.OrderByDescending(p => p.When)
.Skip(offset)