Merge pull request #391 from KingofBeast/master

Add OnSteamNetAuthenticationStatus and SteamServer.SteamId
This commit is contained in:
Garry Newman 2020-03-13 18:39:13 +00:00 committed by GitHub
commit 4c353264cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,7 @@ namespace Steamworks
Dispatch.Install<SteamServersConnected_t>( x => OnSteamServersConnected?.Invoke(), true );
Dispatch.Install<SteamServerConnectFailure_t>( x => OnSteamServerConnectFailure?.Invoke( x.Result, x.StillRetrying ), true );
Dispatch.Install<SteamServersDisconnected_t>( x => OnSteamServersDisconnected?.Invoke( x.Result ), true );
Dispatch.Install<SteamNetAuthenticationStatus_t>(x => OnSteamNetAuthenticationStatus?.Invoke(x.Avail), true);
}
/// <summary>
@ -51,6 +52,11 @@ namespace Steamworks
/// </summary>
public static event Action<Result> OnSteamServersDisconnected;
/// <summary>
/// Called when authentication status changes, useful for grabbing SteamId once aavailability is current
/// </summary>
public static event Action<SteamNetworkingAvailability> OnSteamNetAuthenticationStatus;
/// <summary>
/// Initialize the steam server.
@ -269,6 +275,8 @@ namespace Steamworks
}
private static string _gametags = "";
public static SteamId SteamId => Internal.GetSteamID();
/// <summary>
/// Log onto Steam anonymously.
/// </summary>