mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-09 23:00:57 -05:00
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:
@ -40,7 +40,16 @@ namespace SharedLibraryCore.Objects
|
||||
|
||||
public async Task Tell(String Message)
|
||||
{
|
||||
await CurrentServer.Tell(Message, this);
|
||||
var e = new GameEvent()
|
||||
{
|
||||
Message = Message,
|
||||
Target = this,
|
||||
Owner = CurrentServer,
|
||||
Type = GameEvent.EventType.Tell,
|
||||
Data = Message
|
||||
};
|
||||
|
||||
CurrentServer.Manager.GetEventHandler().AddEvent(e);
|
||||
}
|
||||
|
||||
public async Task Kick(String Message, Player Sender)
|
||||
|
@ -127,6 +127,16 @@ namespace SharedLibraryCore
|
||||
{
|
||||
#if !DEBUG
|
||||
string formattedMessage = String.Format(RconParser.GetCommandPrefixes().Say, Message);
|
||||
|
||||
var e = new GameEvent()
|
||||
{
|
||||
Message = formattedMessage,
|
||||
Data = formattedMessage,
|
||||
Owner = this,
|
||||
Type = GameEvent.EventType.Broadcast,
|
||||
};
|
||||
|
||||
Manager.GetEventHandler().AddEvent(e);
|
||||
await this.ExecuteCommandAsync(formattedMessage);
|
||||
#else
|
||||
Logger.WriteVerbose(Message.StripColors());
|
||||
@ -141,7 +151,6 @@ namespace SharedLibraryCore
|
||||
/// <param name="Target">Player to send message to</param>
|
||||
public async Task Tell(String Message, Player Target)
|
||||
{
|
||||
|
||||
#if !DEBUG
|
||||
string formattedMessage = String.Format(RconParser.GetCommandPrefixes().Tell, Target.ClientNumber, Message);
|
||||
if (Target.ClientNumber > -1 && Message.Length > 0 && Target.Level != Player.Permission.Console)
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user