From 2474c3de99cd574f4a079164b71acf263362da05 Mon Sep 17 00:00:00 2001 From: Daniel Menard Date: Fri, 23 Feb 2018 13:31:50 -0500 Subject: [PATCH] Added ability to register to OnLobbyJoinRequested callback --- Facepunch.Steamworks/Client/Lobby.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Facepunch.Steamworks/Client/Lobby.cs b/Facepunch.Steamworks/Client/Lobby.cs index df9c0a5..ccca631 100644 --- a/Facepunch.Steamworks/Client/Lobby.cs +++ b/Facepunch.Steamworks/Client/Lobby.cs @@ -37,6 +37,9 @@ public Lobby( Client c ) { client = c; + // For backwards compatibility + OnLobbyJoinRequested = Join; + client.RegisterCallback( OnLobbyDataUpdatedAPI ); client.RegisterCallback( OnLobbyChatMessageRecievedAPI ); client.RegisterCallback( OnLobbyStateUpdatedAPI ); @@ -493,12 +496,17 @@ public void OpenFriendInviteOverlay() /// public Action OnUserInvitedToLobby; + /// + /// Called when a user accepts an invitation to a lobby while the game is running. The parameter is a lobby id. + /// + public Action OnLobbyJoinRequested; + /// /// Joins a lobby if a request was made to join the lobby through the friends list or an invite /// internal void OnLobbyJoinRequestedAPI( GameLobbyJoinRequested_t callback ) { - Join( callback.SteamIDLobby ); + if (OnLobbyJoinRequested != null) { OnLobbyJoinRequested(callback.SteamIDLobby); } } ///