mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-07 13:48:00 -05:00
add clear all reports command
This commit is contained in:
parent
7ecbf8544a
commit
539050d95f
31
Application/Commands/ClearAllReportsCommand.cs
Normal file
31
Application/Commands/ClearAllReportsCommand.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System.Threading.Tasks;
|
||||
using Data.Models.Client;
|
||||
using SharedLibraryCore;
|
||||
using SharedLibraryCore.Configuration;
|
||||
using SharedLibraryCore.Interfaces;
|
||||
|
||||
namespace IW4MAdmin.Application.Commands;
|
||||
|
||||
public class ClearAllReportsCommand : Command
|
||||
{
|
||||
public ClearAllReportsCommand(CommandConfiguration config, ITranslationLookup layout) : base(config, layout)
|
||||
{
|
||||
Name = "clearallreports";
|
||||
Description = _translationLookup["COMMANDS_REPORTS_CLEAR_DESC"];
|
||||
Alias = "car";
|
||||
Permission = EFClient.Permission.Administrator;
|
||||
RequiresTarget = false;
|
||||
}
|
||||
|
||||
public override Task ExecuteAsync(GameEvent gameEvent)
|
||||
{
|
||||
foreach (var server in gameEvent.Owner.Manager.GetServers())
|
||||
{
|
||||
server.Reports.Clear();
|
||||
}
|
||||
|
||||
gameEvent.Origin.Tell(_translationLookup["COMMANDS_REPORTS_CLEAR_SUCCESS"]);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user