LoginPlayer
Logs a player into ACL.
C# Syntax
LoginResult NAPI.ACL.LoginPlayer(Client player, string password);
Parameters
- player: parameter input should be in Client type
- password: parameter input should be in string type
Example
[Command(ACLRequired = true, SensitiveInfo = true)]
public void AdminLogin(Client client, string password)
{
string reason;
var result = NAPI.ACL.LoginPlayer(client, password);
switch (result)
{
case LoginResult.NoAccountFound:
reason = "~r~ERROR: No account found.";
break;
case LoginResult.LoginSuccessfulNoPassword:
case LoginResult.LoginSuccessful:
reason = "~g~SUCCESS: You have successfully logged in.";
break;
case LoginResult.WrongPassword:
reason = "~r~ERROR: Wrong password.";
break;
case LoginResult.AlreadyLoggedIn:
reason = "~r~ERROR: You're already logged in.";
break;
case LoginResult.ACLDisabled:
reason = "~r~ERROR: ACL is disabled.";
break;
}
client.SendChatMessage(reason);
}