1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-13 00:28:10 -05:00

update parser selection menu text during setup

update IW4 script commands gsc and plugin to give base example
fix issue with new account alias linking (I think)
This commit is contained in:
RaidMax
2020-01-21 18:08:18 -06:00
parent 5fc68abce9
commit c17ee0a352
23 changed files with 182 additions and 433 deletions

View File

@ -0,0 +1,36 @@
using SharedLibraryCore;
using System.Linq;
using System.Threading.Tasks;
namespace IW4ScriptCommands
{
/// <summary>
/// Contains basic properties for command information read by gsc
/// </summary>
class ScriptCommand
{
/// <summary>
/// Name of the command to execute
/// </summary>
public string CommandName { get; set; }
/// <summary>
/// Target client number
/// </summary>
public int ClientNumber { get; set; }
/// <summary>
/// Arguments for the script function itself
/// </summary>
public string[] CommandArguments { get; set; } = new string[0];
public override string ToString() => string.Join(";", new[] { CommandName, ClientNumber.ToString() }.Concat(CommandArguments).Select(_arg => _arg.Replace(";", "")));
/// <summary>
/// Executes the command
/// </summary>
/// <param name="server">server to execute the command on</param>
/// <returns></returns>
public async Task Execute(Server server) => await server.SetDvarAsync("sv_iw4madmin_command", ToString());
}
}