mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-27 23:25:55 +03:00
Don't catch and send exceptions to OnCallbackException in RunCallbacks (but do in RunCallbacksAsync)
This commit is contained in:
parent
a02d1e87a7
commit
71b977ef7e
@ -41,8 +41,11 @@ public static void Init( uint appid )
|
||||
SteamNetworkingSockets.InstallEvents();
|
||||
SteamInput.InstallEvents();
|
||||
|
||||
if ( asyncCallbacks )
|
||||
{
|
||||
RunCallbacksAsync();
|
||||
}
|
||||
}
|
||||
|
||||
static List<SteamInterface> openIterfaces = new List<SteamInterface>();
|
||||
|
||||
@ -73,8 +76,16 @@ internal static async void RunCallbacksAsync()
|
||||
while ( IsValid )
|
||||
{
|
||||
await Task.Delay( 16 );
|
||||
|
||||
try
|
||||
{
|
||||
RunCallbacks();
|
||||
}
|
||||
catch ( System.Exception e )
|
||||
{
|
||||
OnCallbackException?.Invoke( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Shutdown()
|
||||
@ -123,15 +134,8 @@ public static void RunCallbacks()
|
||||
{
|
||||
if ( !IsValid ) return;
|
||||
|
||||
try
|
||||
{
|
||||
SteamAPI.RunCallbacks();
|
||||
}
|
||||
catch ( System.Exception e )
|
||||
{
|
||||
OnCallbackException?.Invoke( e );
|
||||
}
|
||||
}
|
||||
|
||||
internal static void UnregisterCallback( IntPtr intPtr )
|
||||
{
|
||||
|
@ -104,8 +104,11 @@ public static void Init( AppId appid, SteamServerInit init )
|
||||
|
||||
InstallEvents();
|
||||
|
||||
if ( asyncCallbacks )
|
||||
{
|
||||
RunCallbacksAsync();
|
||||
}
|
||||
}
|
||||
|
||||
static List<SteamInterface> openIterfaces = new List<SteamInterface>();
|
||||
|
||||
@ -146,8 +149,16 @@ public static void Shutdown()
|
||||
internal static async void RunCallbacksAsync()
|
||||
{
|
||||
while ( IsValid )
|
||||
{
|
||||
try
|
||||
{
|
||||
RunCallbacks();
|
||||
}
|
||||
catch ( System.Exception e )
|
||||
{
|
||||
OnCallbackException?.Invoke( e );
|
||||
}
|
||||
|
||||
await Task.Delay( 16 );
|
||||
}
|
||||
}
|
||||
@ -156,16 +167,9 @@ internal static async void RunCallbacksAsync()
|
||||
/// Run the callbacks. This is also called in Async callbacks.
|
||||
/// </summary>
|
||||
public static void RunCallbacks()
|
||||
{
|
||||
try
|
||||
{
|
||||
SteamGameServer.RunCallbacks();
|
||||
}
|
||||
catch ( System.Exception e )
|
||||
{
|
||||
OnCallbackException?.Invoke( e );
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets whether this should be marked as a dedicated server.
|
||||
|
Loading…
Reference in New Issue
Block a user