Scuffy console command input, good enough for now
This commit is contained in:
parent
bc16f0c421
commit
ac57ecb939
|
@ -18,7 +18,7 @@ public class tESTcOMMAND : Command
|
|||
|
||||
string output = string.Empty;
|
||||
|
||||
switch (Type.ToLower())
|
||||
switch (Type?.ToLower())
|
||||
{
|
||||
case "encrypt":
|
||||
output = Crypto.Encrypt(Value, "test");
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
using Elisa.Commands;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Elisa.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("/")]
|
||||
public class CommandController : ControllerBase
|
||||
{
|
||||
[HttpGet("command")]
|
||||
public async Task<IResult> Command([FromQuery] string command)
|
||||
{
|
||||
CommandHandlerFactory.HandleCommand(command);
|
||||
|
||||
return Results.Text("Command executed");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
using Elisa.Commands;
|
||||
|
||||
namespace Elisa;
|
||||
|
||||
public static class InputSystem
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
string? command = Console.ReadLine();
|
||||
|
||||
if (string.IsNullOrEmpty(command))
|
||||
continue;
|
||||
|
||||
CommandHandlerFactory.HandleCommand(command);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -36,6 +36,7 @@ internal static class Program
|
|||
stopwatch.Stop();
|
||||
Log.Information($"Done! Loaded in {stopwatch.ElapsedMilliseconds}ms");
|
||||
|
||||
Task.Run(InputSystem.Start);
|
||||
Task.Run(Proxy.Start);
|
||||
Task.Run(GameServer.Start).Wait();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue