mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-16 00:28:22 +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 @@ namespace Steamworks
|
|||||||
SteamNetworkingSockets.InstallEvents();
|
SteamNetworkingSockets.InstallEvents();
|
||||||
SteamInput.InstallEvents();
|
SteamInput.InstallEvents();
|
||||||
|
|
||||||
|
if ( asyncCallbacks )
|
||||||
|
{
|
||||||
RunCallbacksAsync();
|
RunCallbacksAsync();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static List<SteamInterface> openIterfaces = new List<SteamInterface>();
|
static List<SteamInterface> openIterfaces = new List<SteamInterface>();
|
||||||
|
|
||||||
@ -73,8 +76,16 @@ namespace Steamworks
|
|||||||
while ( IsValid )
|
while ( IsValid )
|
||||||
{
|
{
|
||||||
await Task.Delay( 16 );
|
await Task.Delay( 16 );
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
RunCallbacks();
|
RunCallbacks();
|
||||||
}
|
}
|
||||||
|
catch ( System.Exception e )
|
||||||
|
{
|
||||||
|
OnCallbackException?.Invoke( e );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Shutdown()
|
public static void Shutdown()
|
||||||
@ -123,15 +134,8 @@ namespace Steamworks
|
|||||||
{
|
{
|
||||||
if ( !IsValid ) return;
|
if ( !IsValid ) return;
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
SteamAPI.RunCallbacks();
|
SteamAPI.RunCallbacks();
|
||||||
}
|
}
|
||||||
catch ( System.Exception e )
|
|
||||||
{
|
|
||||||
OnCallbackException?.Invoke( e );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static void UnregisterCallback( IntPtr intPtr )
|
internal static void UnregisterCallback( IntPtr intPtr )
|
||||||
{
|
{
|
||||||
|
@ -104,8 +104,11 @@ namespace Steamworks
|
|||||||
|
|
||||||
InstallEvents();
|
InstallEvents();
|
||||||
|
|
||||||
|
if ( asyncCallbacks )
|
||||||
|
{
|
||||||
RunCallbacksAsync();
|
RunCallbacksAsync();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static List<SteamInterface> openIterfaces = new List<SteamInterface>();
|
static List<SteamInterface> openIterfaces = new List<SteamInterface>();
|
||||||
|
|
||||||
@ -146,8 +149,16 @@ namespace Steamworks
|
|||||||
internal static async void RunCallbacksAsync()
|
internal static async void RunCallbacksAsync()
|
||||||
{
|
{
|
||||||
while ( IsValid )
|
while ( IsValid )
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
RunCallbacks();
|
RunCallbacks();
|
||||||
|
}
|
||||||
|
catch ( System.Exception e )
|
||||||
|
{
|
||||||
|
OnCallbackException?.Invoke( e );
|
||||||
|
}
|
||||||
|
|
||||||
await Task.Delay( 16 );
|
await Task.Delay( 16 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -156,16 +167,9 @@ namespace Steamworks
|
|||||||
/// Run the callbacks. This is also called in Async callbacks.
|
/// Run the callbacks. This is also called in Async callbacks.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void RunCallbacks()
|
public static void RunCallbacks()
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
SteamGameServer.RunCallbacks();
|
SteamGameServer.RunCallbacks();
|
||||||
}
|
}
|
||||||
catch ( System.Exception e )
|
|
||||||
{
|
|
||||||
OnCallbackException?.Invoke( e );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets whether this should be marked as a dedicated server.
|
/// Sets whether this should be marked as a dedicated server.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user