/// <summary> /// /// </summary> /// <param name="client"></param> /// <param name="accountName"></param> /// <param name="password"></param> private void ProcessAuthentification(AuthClient client, string accountName, string password) { client.FrameManager.RemoveFrame(AuthentificationFrame.Instance); var account = AccountRepository.Instance.GetByName(accountName); if (account == null || Util.CryptPassword(client.AuthKey, account.Password) != password) { client.Send(AuthMessage.AUTH_FAILED_CREDENTIALS()); return; } if (account.Banned) { client.Send(AuthMessage.AUTH_FAILED_BANNED()); return; } if (AuthService.Instance.IsConnected(account.Id)) { client.Send(AuthMessage.AUTH_FAILED_ALREADY_CONNECTED()); return; } AuthService.Instance.AddMessage(() => { client.Account = account; AuthService.Instance.ClientAuthentified(client); client.Send(AuthMessage.ACCOUNT_PSEUDO(account.Pseudo)); client.Send(AuthMessage.UNKNOW_AC0()); AuthService.Instance.SendWorldList(client); client.Send(AuthMessage.ACCOUNT_RIGHT(client.Account.Power)); client.Send(AuthMessage.ACCOUNT_SECRET_ANSWER()); client.FrameManager.AddFrame(WorldSelectionFrame.Instance); }); }