mirror of
https://git.battle-of-pip.de/root/vpr-mitarbeiterverwaltung.git
synced 2025-06-21 00:03:18 +02:00
34 lines
810 B
C#
34 lines
810 B
C#
using System.Net.Sockets;
|
|
using DX86;
|
|
using MySqlX.XDevAPI;
|
|
|
|
namespace Server.Commands;
|
|
|
|
public class LoginCommand : ICommand
|
|
{
|
|
public string Executor { get; }
|
|
|
|
public LoginCommand()
|
|
{
|
|
Executor = "login";
|
|
}
|
|
public string Exec(string[] args, TcpClient? client, TcpServer? clientSocket)
|
|
{
|
|
|
|
if (args[0] == "test" && args[1] == "test")
|
|
{
|
|
if (client != null)
|
|
{
|
|
//clientSocket?.SendMessageAsync(client, "Login successful");
|
|
clientSocket?.LoggedInClients.Add(client, "test");
|
|
return "Login successful";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (client != null) return "Invalid credentials";
|
|
}
|
|
|
|
return "No client provided or invalid credentials";
|
|
}
|
|
} |