Elisa/Elisa.GameServer/Commands/TestCommand.cs

37 lines
933 B
C#
Raw Permalink Normal View History

using Elisa.Common.Utils;
using Serilog;
namespace Elisa.GameServer.Commands;
[CommandHandler("test", "Command to test various functions", "test type=encrypt value=asdf")]
public class tESTcOMMAND : Command
{
[Argument("type")]
public string? Type { get; set; }
[Argument("value")]
public string? Value { get; set; }
public override void Execute(Dictionary<string, string> args)
{
base.Execute(args);
string output = string.Empty;
switch (Type?.ToLower())
{
case "encrypt":
output = Crypto.Encrypt(Value, "test");
Console.WriteLine(output);
break;
case "decrypt":
output = Crypto.Decrypt(Value, "test");
Console.WriteLine(output);
break;
default:
Log.Error("Invalid test type");
break;
}
}
}