Added ability to register to OnLobbyJoinRequested callback

This commit is contained in:
Daniel Menard 2018-02-23 13:31:50 -05:00
parent 6b5f8f7481
commit 2474c3de99

View File

@ -37,6 +37,9 @@ public Lobby( Client c )
{
client = c;
// For backwards compatibility
OnLobbyJoinRequested = Join;
client.RegisterCallback<SteamNative.LobbyDataUpdate_t>( OnLobbyDataUpdatedAPI );
client.RegisterCallback<SteamNative.LobbyChatMsg_t>( OnLobbyChatMessageRecievedAPI );
client.RegisterCallback<SteamNative.LobbyChatUpdate_t>( OnLobbyStateUpdatedAPI );
@ -493,12 +496,17 @@ public void OpenFriendInviteOverlay()
/// </summary>
public Action<ulong, ulong> OnUserInvitedToLobby;
/// <summary>
/// Called when a user accepts an invitation to a lobby while the game is running. The parameter is a lobby id.
/// </summary>
public Action<ulong> OnLobbyJoinRequested;
/// <summary>
/// Joins a lobby if a request was made to join the lobby through the friends list or an invite
/// </summary>
internal void OnLobbyJoinRequestedAPI( GameLobbyJoinRequested_t callback )
{
Join( callback.SteamIDLobby );
if (OnLobbyJoinRequested != null) { OnLobbyJoinRequested(callback.SteamIDLobby); }
}
/// <summary>