예제 #1
0
        private async Task <QueryStringBuilder> GetConfirmationParameters(string tag)
        {
            if (string.IsNullOrEmpty(DeviceId))
            {
                throw new ArgumentException("Device Id is not present");
            }

            var time = await SteamTime.GetTime().ConfigureAwait(false);

            return(new QueryStringBuilder
            {
                { "p", DeviceId },
                { "a", Session.SteamId },
                { "k", GenerateConfirmationHashForTime(time, tag) },
                { "t", time.ToUnixTime() },
                { "m", MobileSession.ClientName },
                { "tag", tag }
            });
        }
예제 #2
0
 /// <summary>
 ///     Generates and returns a new steam guard code.
 /// </summary>
 /// <returns>The newly generated steam guard code.</returns>
 public async Task <string> GenerateSteamGuardCode()
 {
     return(GenerateSteamGuardCodeForTime(await SteamTime.GetTime().ConfigureAwait(false)));
 }
예제 #3
0
 /// <summary>
 ///     Generates and returns a new steam guard code using the passed shared secret.
 /// </summary>
 /// <param name="sharedSecret">The shared secret to generate steam guard code from.</param>
 /// <returns>
 ///     The newly generated steam guard code.
 /// </returns>
 public static async Task <string> GenerateSteamGuardCode(byte[] sharedSecret)
 {
     return(GenerateSteamGuardCodeForTime(sharedSecret, await SteamTime.GetTime().ConfigureAwait(false)));
 }