Add SteamServersConnected_t and SteamServerConnectFailure_t callbacks to SteamServer

This commit is contained in:
Daniil Trishkin 2019-05-17 01:08:35 +02:00
parent f06b4b431b
commit 5f7bd08320

View File

@ -37,7 +37,8 @@ internal static ISteamGameServer Internal
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 );
SteamServersConnected_t.Install( x => OnSteamServersConnected?.Invoke(), true );
SteamServerConnectFailure_t.Install( x => OnSteamServerConnectFailure?.Invoke(), true );
} }
/// <summary> /// <summary>
@ -45,6 +46,17 @@ internal static void InstallEvents()
/// </summary> /// </summary>
public static event Action<SteamId, SteamId, AuthResponse> OnValidateAuthTicketResponse; public static event Action<SteamId, SteamId, AuthResponse> OnValidateAuthTicketResponse;
/// <summary>
/// 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.
/// </summary>
public static event Action OnSteamServersConnected;
/// <summary>
/// Called when a connection attempt has failed.
/// </summary>
public static event Action OnSteamServerConnectFailure;
public static void Init( AppId appid, SteamServerInit init ) public static void Init( AppId appid, SteamServerInit init )
{ {
uint ipaddress = 0; // Any Port uint ipaddress = 0; // Any Port