mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-14 07:38:06 +03:00
Pull req - OnLobbyEntered Action and JoinLobbyAsync
Added an OnLobbyEntered action with associated LobbyEnter_t event install, and added a JoinLobbyAsync method which returns the joined lobby if successful
This commit is contained in:
parent
cb06574820
commit
ade772d195
@ -37,7 +37,7 @@ namespace Steamworks
|
||||
{
|
||||
LobbyInvite_t.Install( x => OnLobbyInvite?.Invoke( new Friend( x.SteamIDUser ), new Lobby( x.SteamIDLobby ) ) );
|
||||
|
||||
LobbyEnter_t.Install( x => OnLobbyEntered?.Invoke( new Lobby(x.SteamIDLobby ) ) );
|
||||
LobbyEnter_t.Install( x => OnLobbyEntered?.Invoke( new Lobby(x.SteamIDLobby ) ) );
|
||||
|
||||
LobbyDataUpdate_t.Install( x =>
|
||||
{
|
||||
@ -92,10 +92,10 @@ namespace Steamworks
|
||||
/// </summary>
|
||||
public static event Action<Friend, Lobby> OnLobbyInvite;
|
||||
|
||||
/// <summary>
|
||||
/// You joined a lobby
|
||||
/// </summary>
|
||||
public static event Action<Lobby> OnLobbyEntered;
|
||||
/// <summary>
|
||||
/// You joined a lobby
|
||||
/// </summary>
|
||||
public static event Action<Lobby> OnLobbyEntered;
|
||||
|
||||
/// <summary>
|
||||
/// The lobby metadata has changed
|
||||
@ -150,16 +150,16 @@ namespace Steamworks
|
||||
return new Lobby { Id = lobby.Value.SteamIDLobby };
|
||||
}
|
||||
|
||||
/// <summmary>
|
||||
/// Attempts to directly join the specified lobby
|
||||
/// </summmary>
|
||||
public static async Task<Lobby?> JoinLobbyAsync( SteamId lobbyId )
|
||||
{
|
||||
var lobby = await Internal.JoinLobby( lobbyId );
|
||||
if ( !lobby.HasValue ) return null;
|
||||
/// <summmary>
|
||||
/// Attempts to directly join the specified lobby
|
||||
/// </summmary>
|
||||
public static async Task<Lobby?> JoinLobbyAsync( SteamId lobbyId )
|
||||
{
|
||||
var lobby = await Internal.JoinLobby( lobbyId );
|
||||
if ( !lobby.HasValue ) return null;
|
||||
|
||||
return new Lobby { Id = lobby.Value.SteamIDLobby };
|
||||
}
|
||||
return new Lobby { Id = lobby.Value.SteamIDLobby };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a list of servers that are on your favorites list
|
||||
|
Loading…
x
Reference in New Issue
Block a user