mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-27 15:15:51 +03:00
SteamServer.Update becomes RunCallbacks, has OnCallbackException
This commit is contained in:
parent
9339477c89
commit
85c55a5bb1
@ -31,6 +31,9 @@ internal static ISteamGameServer Internal
|
||||
|
||||
public static bool IsValid => initialized;
|
||||
|
||||
|
||||
public static Action<Exception> 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()
|
||||
|
||||
/// <summary>
|
||||
/// Run the callbacks. This is also called in Async callbacks.
|
||||
/// </summary>
|
||||
public static void RunCallbacks()
|
||||
{
|
||||
try
|
||||
{
|
||||
SteamGameServer.RunCallbacks();
|
||||
}
|
||||
catch ( System.Exception )
|
||||
catch ( System.Exception e )
|
||||
{
|
||||
// TODO - error outputs
|
||||
OnCallbackException?.Invoke( e );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user