mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-28 15:45:29 +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 bool IsValid => initialized;
|
||||||
|
|
||||||
|
|
||||||
|
public static Action<Exception> OnCallbackException;
|
||||||
|
|
||||||
internal static void InstallEvents()
|
internal static void InstallEvents()
|
||||||
{
|
{
|
||||||
ValidateAuthTicketResponse_t.Install( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ), true );
|
ValidateAuthTicketResponse_t.Install( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ), true );
|
||||||
@ -98,18 +101,22 @@ internal static async void RunCallbacksAsync()
|
|||||||
while ( IsValid )
|
while ( IsValid )
|
||||||
{
|
{
|
||||||
await Task.Delay( 16 );
|
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
|
try
|
||||||
{
|
{
|
||||||
SteamGameServer.RunCallbacks();
|
SteamGameServer.RunCallbacks();
|
||||||
}
|
}
|
||||||
catch ( System.Exception )
|
catch ( System.Exception e )
|
||||||
{
|
{
|
||||||
// TODO - error outputs
|
OnCallbackException?.Invoke( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user