Beispiel #1
0
        internal async Task <Steam.ConfirmationDetails> GetConfirmationDetails(Confirmation confirmation)
        {
            if (confirmation == null)
            {
                Bot.ArchiLogger.LogNullError(nameof(confirmation));
                return(null);
            }

            if (!HasCorrectDeviceID)
            {
                Bot.ArchiLogger.LogGenericError(Strings.ErrorMobileAuthenticatorInvalidDeviceID);
                return(null);
            }

            uint time = await GetSteamTime().ConfigureAwait(false);

            if (time == 0)
            {
                Bot.ArchiLogger.LogNullError(nameof(time));
                return(null);
            }

            string confirmationHash = GenerateConfirmationKey(time, "conf");

            if (string.IsNullOrEmpty(confirmationHash))
            {
                Bot.ArchiLogger.LogNullError(nameof(confirmationHash));
                return(null);
            }

            Steam.ConfirmationDetails response = await Bot.ArchiWebHandler.GetConfirmationDetails(DeviceID, confirmationHash, time, confirmation).ConfigureAwait(false);

            if ((response == null) || !response.Success)
            {
                return(null);
            }

            return(response);
        }
Beispiel #2
0
        internal async Task <Steam.ConfirmationDetails> GetConfirmationDetails(Confirmation confirmation)
        {
            if (confirmation == null)
            {
                Logging.LogNullError(nameof(confirmation), Bot.BotName);
                return(null);
            }

            if (!HasCorrectDeviceID)
            {
                Logging.LogGenericWarning("Can't execute properly due to invalid DeviceID!", Bot.BotName);
                return(null);
            }

            uint time = await GetSteamTime().ConfigureAwait(false);

            if (time == 0)
            {
                Logging.LogNullError(nameof(time), Bot.BotName);
                return(null);
            }

            string confirmationHash = GenerateConfirmationKey(time, "conf");

            if (string.IsNullOrEmpty(confirmationHash))
            {
                Logging.LogNullError(nameof(confirmationHash), Bot.BotName);
                return(null);
            }

            Steam.ConfirmationDetails response = await Bot.ArchiWebHandler.GetConfirmationDetails(DeviceID, confirmationHash, time, confirmation).ConfigureAwait(false);

            if ((response == null) || !response.Success)
            {
                return(null);
            }

            return(response);
        }