From 5f7bd08320cbb045eebfe01b65bc2ecdcbff0550 Mon Sep 17 00:00:00 2001 From: Daniil Trishkin Date: Fri, 17 May 2019 01:08:35 +0200 Subject: [PATCH] Add SteamServersConnected_t and SteamServerConnectFailure_t callbacks to SteamServer --- Facepunch.Steamworks/SteamServer.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Facepunch.Steamworks/SteamServer.cs b/Facepunch.Steamworks/SteamServer.cs index 873a9a8..2fe6197 100644 --- a/Facepunch.Steamworks/SteamServer.cs +++ b/Facepunch.Steamworks/SteamServer.cs @@ -37,7 +37,8 @@ namespace Steamworks internal static void InstallEvents() { ValidateAuthTicketResponse_t.Install( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ), true ); - + SteamServersConnected_t.Install( x => OnSteamServersConnected?.Invoke(), true ); + SteamServerConnectFailure_t.Install( x => OnSteamServerConnectFailure?.Invoke(), true ); } /// @@ -45,6 +46,17 @@ namespace Steamworks /// public static event Action OnValidateAuthTicketResponse; + /// + /// Called when a connections to the Steam back-end has been established. + /// This means the server now is logged on and has a working connection to the Steam master server. + /// + public static event Action OnSteamServersConnected; + + /// + /// Called when a connection attempt has failed. + /// + public static event Action OnSteamServerConnectFailure; + public static void Init( AppId appid, SteamServerInit init ) { uint ipaddress = 0; // Any Port