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

@ -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 =>
{

View File

@ -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>