LobbyQuery String Filter

Added LobbyList FilterStringKeyValue method, fixed spacing on SteamMatchmaking.LobbyEnter_t.Install() parameter
This commit is contained in:
thesupersoup 2019-06-23 14:19:16 -07:00
parent ade772d195
commit 56efc9f48b
2 changed files with 24 additions and 2 deletions

View File

@ -43,6 +43,24 @@ public LobbyQuery FilterDistanceWorldwide()
} }
#endregion #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 #region Slots Filter
internal int? slotsAvailable; internal int? slotsAvailable;
@ -71,7 +89,6 @@ public LobbyQuery WithMaxResults( int max )
#endregion #endregion
void ApplyFilters() void ApplyFilters()
{ {
if ( distance.HasValue ) if ( distance.HasValue )
@ -88,6 +105,11 @@ void ApplyFilters()
{ {
SteamMatchmaking.Internal.AddRequestLobbyListResultCountFilter( maxResults.Value ); SteamMatchmaking.Internal.AddRequestLobbyListResultCountFilter( maxResults.Value );
} }
if( stringFilter.HasValue )
{
SteamMatchmaking.Internal.AddRequestLobbyListStringFilter( stringFilter.Value.Key, stringFilter.Value.Value, LobbyComparison.Equal );
}
} }
/// <summary> /// <summary>