mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 14:15:47 +03:00
Merge pull request #132 from dblstallion/master
Added ability to register to OnLobbyJoinRequested callback
This commit is contained in:
commit
aa3a6d4d24
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user