2024-05-27 12:29:01 +00:00
|
|
|
|
using Elisa.Common.Utils;
|
2024-05-25 04:43:43 +00:00
|
|
|
|
using Serilog;
|
|
|
|
|
|
2024-05-27 12:29:01 +00:00
|
|
|
|
namespace Elisa.GameServer.Commands;
|
2024-05-25 04:43:43 +00:00
|
|
|
|
|
|
|
|
|
[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;
|
|
|
|
|
|
2024-05-27 00:10:08 +00:00
|
|
|
|
switch (Type?.ToLower())
|
2024-05-25 04:43:43 +00:00
|
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|