diff --git a/Facepunch.Steamworks/SteamServer.cs b/Facepunch.Steamworks/SteamServer.cs index 7e82f77..82d3485 100644 --- a/Facepunch.Steamworks/SteamServer.cs +++ b/Facepunch.Steamworks/SteamServer.cs @@ -31,6 +31,9 @@ internal static ISteamGameServer Internal public static bool IsValid => initialized; + + public static Action OnCallbackException; + internal static void InstallEvents() { ValidateAuthTicketResponse_t.Install( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ), true ); @@ -98,18 +101,22 @@ internal static async void RunCallbacksAsync() while ( IsValid ) { await Task.Delay( 16 ); - Update(); + RunCallbacks(); } } - public static void Update() + + /// + /// Run the callbacks. This is also called in Async callbacks. + /// + public static void RunCallbacks() { try { SteamGameServer.RunCallbacks(); } - catch ( System.Exception ) + catch ( System.Exception e ) { - // TODO - error outputs + OnCallbackException?.Invoke( e ); } }