mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-27 07:05:50 +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,7 +41,10 @@ public static void Init( uint appid )
|
||||
SteamNetworkingSockets.InstallEvents();
|
||||
SteamInput.InstallEvents();
|
||||
|
||||
RunCallbacksAsync();
|
||||
if ( asyncCallbacks )
|
||||
{
|
||||
RunCallbacksAsync();
|
||||
}
|
||||
}
|
||||
|
||||
static List<SteamInterface> openIterfaces = new List<SteamInterface>();
|
||||
@ -73,7 +76,15 @@ internal static async void RunCallbacksAsync()
|
||||
while ( IsValid )
|
||||
{
|
||||
await Task.Delay( 16 );
|
||||
RunCallbacks();
|
||||
|
||||
try
|
||||
{
|
||||
RunCallbacks();
|
||||
}
|
||||
catch ( System.Exception e )
|
||||
{
|
||||
OnCallbackException?.Invoke( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,14 +134,7 @@ public static void RunCallbacks()
|
||||
{
|
||||
if ( !IsValid ) return;
|
||||
|
||||
try
|
||||
{
|
||||
SteamAPI.RunCallbacks();
|
||||
}
|
||||
catch ( System.Exception e )
|
||||
{
|
||||
OnCallbackException?.Invoke( e );
|
||||
}
|
||||
SteamAPI.RunCallbacks();
|
||||
}
|
||||
|
||||
internal static void UnregisterCallback( IntPtr intPtr )
|
||||
|
@ -104,7 +104,10 @@ public static void Init( AppId appid, SteamServerInit init )
|
||||
|
||||
InstallEvents();
|
||||
|
||||
RunCallbacksAsync();
|
||||
if ( asyncCallbacks )
|
||||
{
|
||||
RunCallbacksAsync();
|
||||
}
|
||||
}
|
||||
|
||||
static List<SteamInterface> openIterfaces = new List<SteamInterface>();
|
||||
@ -147,7 +150,15 @@ internal static async void RunCallbacksAsync()
|
||||
{
|
||||
while ( IsValid )
|
||||
{
|
||||
RunCallbacks();
|
||||
try
|
||||
{
|
||||
RunCallbacks();
|
||||
}
|
||||
catch ( System.Exception e )
|
||||
{
|
||||
OnCallbackException?.Invoke( e );
|
||||
}
|
||||
|
||||
await Task.Delay( 16 );
|
||||
}
|
||||
}
|
||||
@ -157,14 +168,7 @@ internal static async void RunCallbacksAsync()
|
||||
/// </summary>
|
||||
public static void RunCallbacks()
|
||||
{
|
||||
try
|
||||
{
|
||||
SteamGameServer.RunCallbacks();
|
||||
}
|
||||
catch ( System.Exception e )
|
||||
{
|
||||
OnCallbackException?.Invoke( e );
|
||||
}
|
||||
SteamGameServer.RunCallbacks();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user