Skip to main content

LoginPlayer

Logs a player into ACL.

  • player: parameter input should be in Client type
  • password: parameter input should be in string type

{{#tag:syntaxhighlight| [Command(ACLRequired = true, SensitiveInfo = true)] public void AdminLogin(Client client, string password) {

   string reason;
   var result = ``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);

} |lang=csharp}} }}