1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-07-06 03:50:18 -05:00
implement basic run-as functionality
This commit is contained in:
RaidMax
2020-04-26 21:12:49 -05:00
parent 6757f9055c
commit 9a245c4db2
20 changed files with 1294 additions and 18 deletions

View File

@ -0,0 +1,36 @@
using SharedLibraryCore;
using SharedLibraryCore.Configuration;
using SharedLibraryCore.Interfaces;
using System;
using System.Threading.Tasks;
namespace ApplicationTests.Mocks
{
class ImpersonatableCommand : Command
{
public ImpersonatableCommand(CommandConfiguration config, ITranslationLookup lookup) : base(config, lookup)
{
AllowImpersonation = true;
Name = nameof(ImpersonatableCommand);
}
public override Task ExecuteAsync(GameEvent E)
{
E.Origin.Tell("test");
return Task.CompletedTask;
}
}
class NonImpersonatableCommand : Command
{
public NonImpersonatableCommand(CommandConfiguration config, ITranslationLookup lookup) : base(config, lookup)
{
Name = nameof(NonImpersonatableCommand);
}
public override Task ExecuteAsync(GameEvent E)
{
return Task.CompletedTask;
}
}
}