Merge pull request #132 from dblstallion/master

Added ability to register to OnLobbyJoinRequested callback
This commit is contained in:
Garry Newman 2018-02-23 18:52:41 +00:00 committed by GitHub
commit aa3a6d4d24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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