From 6d4639376d848b74fb602bba5c77f45ee17f5bf2 Mon Sep 17 00:00:00 2001 From: KingofBeast Date: Fri, 13 Mar 2020 13:05:21 -0500 Subject: [PATCH] Install OnSteamNetAuthenticationStatus listener, expose SteamServer.SteamId --- Facepunch.Steamworks/SteamServer.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Facepunch.Steamworks/SteamServer.cs b/Facepunch.Steamworks/SteamServer.cs index cc35927..b892760 100644 --- a/Facepunch.Steamworks/SteamServer.cs +++ b/Facepunch.Steamworks/SteamServer.cs @@ -28,6 +28,7 @@ namespace Steamworks Dispatch.Install( x => OnSteamServersConnected?.Invoke(), true ); Dispatch.Install( x => OnSteamServerConnectFailure?.Invoke( x.Result, x.StillRetrying ), true ); Dispatch.Install( x => OnSteamServersDisconnected?.Invoke( x.Result ), true ); + Dispatch.Install(x => OnSteamNetAuthenticationStatus?.Invoke(x.Avail), true); } /// @@ -51,6 +52,11 @@ namespace Steamworks /// public static event Action OnSteamServersDisconnected; + /// + /// Called when authentication status changes, useful for grabbing SteamId once aavailability is current + /// + public static event Action OnSteamNetAuthenticationStatus; + /// /// Initialize the steam server. @@ -269,6 +275,8 @@ namespace Steamworks } private static string _gametags = ""; + public static SteamId SteamId => Internal.GetSteamID(); + /// /// Log onto Steam anonymously. ///