ClanTagRankCommands/Commands/GameInterfaceReconnectCommand.cs
INSANEMODE abbe33f22a - add game interface reconnect comand
- add ScriptReconnect Event
2023-04-23 23:53:34 -05:00

67 lines
1.8 KiB
C#

using SharedLibraryCore;
using SharedLibraryCore.Commands;
using SharedLibraryCore.Configuration;
using SharedLibraryCore.Database.Models;
using SharedLibraryCore.Interfaces;
using SharedLibraryCore.Interfaces.Events;
using System.Threading.Tasks;
namespace ClanTagRankCommands.Commands
{
/// <summary>
/// Example script command
/// </summary>
///
public class GameInterfaceReconnectCommand : Command
{
private readonly IMetaServiceV2 _metaService;
//private readonly IConfigurationHandler<ClanTagConfiguration> _configurationHandler;
private ClanTagConfiguration Config;
public GameInterfaceReconnectCommand(CommandConfiguration config, ITranslationLookup lookup, ClanTagConfiguration _Config, IMetaServiceV2 metaService, IConfigurationHandlerFactory configurationHandlerFactory) : base(config, lookup)
{
_metaService = metaService;
Config = _Config;
Name = "GameInterfaceReconnect";
Description = "set a user's clan tag Rank (does not give permissions)";
Alias = "gir";
Permission = EFClient.Permission.Administrator;
RequiresTarget = false;
//Arguments = new[]
//{
// new CommandArgument()
// {
// Name = "rank",
// Required = true
// }
//};
}
public override Task ExecuteAsync(GameEvent E)
{
var gir = new GameEvent()
{
Origin = Utilities.IW4MAdminClient(),
Owner = E.Owner,
Type = GameEvent.EventType.Other,
Subtype = "ScriptReconnect",
};
E.Owner.ExecuteEvent(gir);
return Task.CompletedTask;
}
}
}