diff --git a/Facepunch.Steamworks.Test/UserTest.cs b/Facepunch.Steamworks.Test/UserTest.cs index 9ddcf4b..8105f86 100644 --- a/Facepunch.Steamworks.Test/UserTest.cs +++ b/Facepunch.Steamworks.Test/UserTest.cs @@ -136,19 +136,43 @@ public void IsPhoneRequiringVerification() [TestMethod] public async Task RequestEncryptedAppTicketAsyncWithData() { - var data = await SteamUser.RequestEncryptedAppTicketAsync( new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 } ); - Assert.IsNotNull( data ); + for ( int i=0; i<10; i++ ) + { + var data = await SteamUser.RequestEncryptedAppTicketAsync( new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 } ); - Console.WriteLine( $"data: {string.Join( "", data.Select( x => x.ToString( "x" ) ))}" ); + if ( data == null ) + { + Console.WriteLine( $"Attempt {i}: Returned null.. waiting 1 seconds" ); + await Task.Delay( 10000 ); + continue; + } + + Console.WriteLine( $"data: {string.Join( "", data.Select( x => x.ToString( "x" ) ) )}" ); + return; + } + + Assert.Fail(); } [TestMethod] public async Task RequestEncryptedAppTicketAsync() { - var data = await SteamUser.RequestEncryptedAppTicketAsync(); - Assert.IsNotNull( data ); + for ( int i = 0; i < 6; i++ ) + { + var data = await SteamUser.RequestEncryptedAppTicketAsync(); - Console.WriteLine( $"data: {string.Join( "", data.Select( x => x.ToString( "x" ) ) )}" ); + if ( data == null ) + { + Console.WriteLine( $"Attempt {i}: Returned null.. waiting 1 seconds" ); + await Task.Delay( 10000 ); + continue; + } + + Console.WriteLine( $"data: {string.Join( "", data.Select( x => x.ToString( "x" ) ) )}" ); + return; + } + + Assert.Fail(); } }