Install SteamNetworkingSockets events when initializing SteamServer

This commit is contained in:
laurirasanen 2019-06-02 13:44:04 +03:00
parent 33703be387
commit 52381d4af8
2 changed files with 4 additions and 3 deletions

View File

@ -81,9 +81,9 @@ namespace Steamworks
ConnectionInterfaces = null; ConnectionInterfaces = null;
} }
internal static void InstallEvents() internal static void InstallEvents( bool server = false )
{ {
SteamNetConnectionStatusChangedCallback_t.Install( x => ConnectionStatusChanged( x ) ); SteamNetConnectionStatusChangedCallback_t.Install( x => ConnectionStatusChanged( x ), server );
} }
private static void ConnectionStatusChanged( SteamNetConnectionStatusChangedCallback_t data ) private static void ConnectionStatusChanged( SteamNetConnectionStatusChangedCallback_t data )

View File

@ -37,6 +37,7 @@ namespace Steamworks
internal static void InstallEvents() internal static void InstallEvents()
{ {
SteamInventory.InstallEvents(); SteamInventory.InstallEvents();
SteamNetworkingSockets.InstallEvents(true);
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 ); SteamServersConnected_t.Install( x => OnSteamServersConnected?.Invoke(), true );