Beispiel #1
0
        public void Login(LoginApiCall login)
        {
            //UseHudData(login.HUD);
            UsePlayerProfileData(login.PlayerProfile);
            Logger.LogLogin(login.PlayerProfile.Codename);

            //foreach (FormationsContentResponses responses in login.Content.FormationsContentResponses)
            //{
            //    Logger.LogData(string.Format("{0},{1},{2},{3},{4}", responses.Name, responses.LevelRequired, responses.Id, responses.BotCost, responses.ConsumableRequired));
            //}
        }
        /// <summary>
        /// A helper method that logs into all of your accounts and sets some
        /// additional metadata on them based on the login information
        /// </summary>
        /// <returns>true if all logins were successful</returns>
        public bool LoginAllAccounts()
        {
            bool successful = true;
            foreach (Player account in _accounts)
            {
                // Perform the actual Login Call
                _loginApiCall = _apiCall.Login(account.Username, account.Password, account.DeviceId);

                // Set some more properties on the account for future usage
                account.Level = _loginApiCall.PlayerProfile.Level;
                account.Faction = _loginApiCall.PlayerProfile.FactionId;

                if (_loginApiCall != null)
                {
                    successful = false;
                    break;
                }
            }

            return successful;
        }