diff --git a/Facepunch.Steamworks/BaseSteamworks.cs b/Facepunch.Steamworks/BaseSteamworks.cs index 435890c..8bb71d7 100644 --- a/Facepunch.Steamworks/BaseSteamworks.cs +++ b/Facepunch.Steamworks/BaseSteamworks.cs @@ -108,10 +108,16 @@ public void RunUpdateCallbacks() /// public void UpdateWhile( Func func ) { + const int sleepMs = 1; + while ( func() ) { Update(); - System.Threading.Thread.Sleep( 1 ); +#if NET_CORE + System.Threading.Tasks.Task.Delay( sleepMs ).Wait(); +#else + System.Threading.Thread.Sleep( sleepMs ); +#endif } } } diff --git a/Facepunch.Steamworks/Client/RemoteStorage.FileStream.cs b/Facepunch.Steamworks/Client/RemoteStorage.FileStream.cs index ea98e87..2c1eecb 100644 --- a/Facepunch.Steamworks/Client/RemoteStorage.FileStream.cs +++ b/Facepunch.Steamworks/Client/RemoteStorage.FileStream.cs @@ -75,7 +75,7 @@ public void Cancel() remoteStorage.native.FileWriteStreamCancel( _handle ); } -#if NETCORE +#if NET_CORE public void Close() #else public override void Close() diff --git a/Facepunch.Steamworks/Client/ServerQuery.cs b/Facepunch.Steamworks/Client/ServerQuery.cs index 159d757..b1abaac 100644 --- a/Facepunch.Steamworks/Client/ServerQuery.cs +++ b/Facepunch.Steamworks/Client/ServerQuery.cs @@ -5,7 +5,7 @@ using System.Net.Sockets; using System.IO; -#if !NETCORE +#if !NET_CORE internal class SourceServerQuery :IDisposable { diff --git a/Facepunch.Steamworks/Interfaces/Workshop.Query.cs b/Facepunch.Steamworks/Interfaces/Workshop.Query.cs index e847ee3..4b26d47 100644 --- a/Facepunch.Steamworks/Interfaces/Workshop.Query.cs +++ b/Facepunch.Steamworks/Interfaces/Workshop.Query.cs @@ -227,11 +227,17 @@ public bool IsRunning /// public void Block() { + const int sleepMs = 10; + workshop.steamworks.Update(); while ( IsRunning ) { - System.Threading.Thread.Sleep( 10 ); +#if NET_CORE + System.Threading.Tasks.Task.Delay( sleepMs ).Wait(); +#else + System.Threading.Thread.Sleep( sleepMs ); +#endif workshop.steamworks.Update(); } } diff --git a/Facepunch.Steamworks/Properties/AssemblyInfo.cs b/Facepunch.Steamworks/Properties/AssemblyInfo.cs index eba09bd..83de1b3 100644 --- a/Facepunch.Steamworks/Properties/AssemblyInfo.cs +++ b/Facepunch.Steamworks/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -#if !NETCORE +#if !NET_CORE // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.cs index 81465af..1d9fc7b 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.cs @@ -37,7 +37,7 @@ internal static Facepunch.Steamworks.OperatingSystem Os { _os = Facepunch.Steamworks.OperatingSystem.Windows; -#if !NETCORE +#if !NET_CORE // // These checks aren't so accurate on older versions of mono //