Finish implementation of configuable command permissions

This commit is contained in:
RaidMax
2020-01-31 20:15:07 -06:00
parent 11ae91281f
commit 318a23ae5b
38 changed files with 373 additions and 213 deletions

View File

@ -1,5 +1,8 @@
using SharedLibraryCore;
using SharedLibraryCore.Commands;
using SharedLibraryCore.Configuration;
using SharedLibraryCore.Database.Models;
using SharedLibraryCore.Interfaces;
using System.Threading.Tasks;
namespace IW4ScriptCommands.Commands
@ -9,15 +12,22 @@ namespace IW4ScriptCommands.Commands
/// </summary>
public class KillPlayerCommand : Command
{
public KillPlayerCommand() : base("killplayer", "kill a player", "kp", EFClient.Permission.Administrator, true, new[]
public KillPlayerCommand(CommandConfiguration config, ITranslationLookup lookup) : base(config, lookup)
{
new CommandArgument()
Name = "killplayer";
Description = "kill a player";
Alias = "kp";
Permission = EFClient.Permission.Administrator;
RequiresTarget = true;
Arguments = new[]
{
Name = "player",
Required = true
}
})
{ }
new CommandArgument()
{
Name = "player",
Required = true
}
};
}
public override async Task ExecuteAsync(GameEvent E)
{

View File

@ -23,7 +23,7 @@ namespace WebfrontCore.Controllers.API
public IActionResult ClientInfo(string networkId)
{
var clientInfo = Manager.GetActiveClients()
.FirstOrDefault(c => c.NetworkId == networkId.ConvertGuidToLong());
.FirstOrDefault(c => c.NetworkId == networkId.ConvertGuidToLong(System.Globalization.NumberStyles.HexNumber));
if (clientInfo != null)
{

View File

@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2.2.4" PrivateAssets="All" />
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2.2.6" PrivateAssets="All" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">