Example #1
0
        public void Authenticate(Actor Actor, String UserName, String Password)
        {
            var existingAccount = Accounts.LoadAccount(UserName);

            if (existingAccount == null || Accounts.VerifyAccount(existingAccount, Password) == false)
            {
                MudObject.SendMessage(Actor, "Could not verify account.");
                return;
            }

            LoginCommandHandler.LogPlayerIn(Actor.ConnectedClient as NetworkClient, existingAccount);
        }
Example #2
0
        public void Authenticate(Actor Actor, String UserName, String Password)
        {
            var existingAccount = Accounts.LoadAccount(UserName);

            if (existingAccount != null)
            {
                MudObject.SendMessage(Actor, "Account already exists.");
                return;
            }

            var newAccount = Accounts.CreateAccount(UserName, Password);

            if (newAccount == null)
            {
                MudObject.SendMessage(Actor, "Could not create account.");
                return;
            }

            LoginCommandHandler.LogPlayerIn(Actor.ConnectedClient as NetworkClient, newAccount);
        }