finer version numbers work correctly.
fix bug with level being reset. add {{ADMINS}} to message tokens modified offset threshold calculation
This commit is contained in:
@ -16,7 +16,7 @@ namespace WebfrontCore.Controllers
|
||||
{
|
||||
protected IManager Manager;
|
||||
protected readonly DatabaseContext Context;
|
||||
protected bool Authorized { get; private set; }
|
||||
protected bool Authorized { get; set; }
|
||||
protected SharedLibraryCore.Localization.Index Localization { get; private set; }
|
||||
protected EFClient Client { get; private set; }
|
||||
private static byte[] LocalHost = { 127, 0, 0, 1 };
|
||||
|
@ -20,6 +20,10 @@ namespace WebfrontCore.Controllers
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
Authorized = true;
|
||||
#endif
|
||||
|
||||
var clientDto = new PlayerInfo()
|
||||
{
|
||||
Name = client.Name,
|
||||
@ -78,6 +82,12 @@ namespace WebfrontCore.Controllers
|
||||
}));
|
||||
}
|
||||
|
||||
if (Authorized)
|
||||
{
|
||||
penaltyMeta.ForEach(p => p.Value.Offense = p.Value.AutomatedOffense ?? p.Value.Offense);
|
||||
administeredPenaltiesMeta.ForEach(p => p.Value.Offense = p.Value.AutomatedOffense ?? p.Value.Offense);
|
||||
}
|
||||
|
||||
clientDto.Meta.AddRange(Authorized ? meta : meta.Where(m => !m.Sensitive));
|
||||
clientDto.Meta.AddRange(Authorized ? penaltyMeta : penaltyMeta.Where(m => !m.Sensitive));
|
||||
clientDto.Meta.AddRange(Authorized ? administeredPenaltiesMeta : administeredPenaltiesMeta.Where(m => !m.Sensitive));
|
||||
|
@ -21,7 +21,11 @@ namespace WebfrontCore.ViewComponents
|
||||
PunisherId = p.PunisherId,
|
||||
PunisherName = p.Punisher.Name,
|
||||
PunisherLevel = p.Punisher.Level.ToString(),
|
||||
#if DEBUG
|
||||
Offense = !string.IsNullOrEmpty(p.AutomatedOffense) ? p.AutomatedOffense : p.Offense,
|
||||
#else
|
||||
Offense = User.Identity.IsAuthenticated && !string.IsNullOrEmpty(p.AutomatedOffense) ? p.AutomatedOffense : p.Offense,
|
||||
#endif
|
||||
Type = p.Type.ToString(),
|
||||
TimePunished = Utilities.GetTimePassed(p.When, false),
|
||||
// show time passed if ban
|
||||
@ -30,7 +34,11 @@ namespace WebfrontCore.ViewComponents
|
||||
AutomatedOffense = p.AutomatedOffense
|
||||
});
|
||||
|
||||
#if DEBUG
|
||||
penaltiesDto = penaltiesDto.ToList();
|
||||
#else
|
||||
penaltiesDto = User.Identity.IsAuthenticated ? penaltiesDto.ToList() : penaltiesDto.Where(p => !p.Sensitive).ToList();
|
||||
#endif
|
||||
|
||||
return View("_List", penaltiesDto);
|
||||
}
|
||||
|
Reference in New Issue
Block a user