mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-27 07:05:50 +03:00
LobbyQuery String Filter
Added LobbyList FilterStringKeyValue method, fixed spacing on SteamMatchmaking.LobbyEnter_t.Install() parameter
This commit is contained in:
parent
ade772d195
commit
56efc9f48b
@ -37,7 +37,7 @@ internal static void InstallEvents()
|
||||
{
|
||||
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 =>
|
||||
{
|
||||
|
@ -43,6 +43,24 @@ public LobbyQuery FilterDistanceWorldwide()
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region String key/value filter
|
||||
internal MatchMakingKeyValuePair_t? stringFilter;
|
||||
|
||||
/// <summary>
|
||||
/// Filter by specified key/value pair
|
||||
/// </summary>
|
||||
public LobbyQuery FilterStringKeyValue( string nKey, string nValue )
|
||||
{
|
||||
stringFilter = new MatchMakingKeyValuePair_t
|
||||
{
|
||||
Key = nKey,
|
||||
Value = nValue
|
||||
};
|
||||
|
||||
return this;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Slots Filter
|
||||
internal int? slotsAvailable;
|
||||
|
||||
@ -71,7 +89,6 @@ public LobbyQuery WithMaxResults( int max )
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
void ApplyFilters()
|
||||
{
|
||||
if ( distance.HasValue )
|
||||
@ -88,6 +105,11 @@ void ApplyFilters()
|
||||
{
|
||||
SteamMatchmaking.Internal.AddRequestLobbyListResultCountFilter( maxResults.Value );
|
||||
}
|
||||
|
||||
if( stringFilter.HasValue )
|
||||
{
|
||||
SteamMatchmaking.Internal.AddRequestLobbyListStringFilter( stringFilter.Value.Key, stringFilter.Value.Value, LobbyComparison.Equal );
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user