mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-14 23:58:12 +03:00
Removed second FilterStringKeyValue method and improved first
Second method was non-functional due to access modifier inconsistency, added IsNullOrEmpty and MaxLobbyKeyLength check to first method, added MaxLobbyKeyLength (and backing field) to SteamMAtchmaking, taken from https://partner.steamgames.com/doc/api/ISteamMatchmaking#constants
This commit is contained in:
parent
6a0a46f495
commit
645e7bd91e
@ -12,6 +12,14 @@ namespace Steamworks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class SteamMatchmaking
|
public static class SteamMatchmaking
|
||||||
{
|
{
|
||||||
|
internal const int k_nMaxLobbyKeyLength = 255;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Maximum number of characters a lobby metadata key can be
|
||||||
|
/// </summary>
|
||||||
|
public static int MaxLobbyKeyLength { get { return k_nMaxLobbyKeyLength; } }
|
||||||
|
|
||||||
|
|
||||||
static ISteamMatchmaking _internal;
|
static ISteamMatchmaking _internal;
|
||||||
|
|
||||||
internal static ISteamMatchmaking Internal
|
internal static ISteamMatchmaking Internal
|
||||||
|
@ -51,21 +51,14 @@ namespace Steamworks.Data
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public LobbyQuery FilterStringKeyValue( string nKey, string nValue )
|
public LobbyQuery FilterStringKeyValue( string nKey, string nValue )
|
||||||
{
|
{
|
||||||
stringFilter = new MatchMakingKeyValuePair_t
|
if ( !string.IsNullOrEmpty(nKey) && nKey.Length <= SteamMatchmaking.MaxLobbyKeyLength )
|
||||||
{
|
{
|
||||||
Key = nKey,
|
stringFilter = new MatchMakingKeyValuePair_t
|
||||||
Value = nValue
|
{
|
||||||
};
|
Key = nKey,
|
||||||
|
Value = nValue
|
||||||
return this;
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Filter by specified key/value pair; MatchMakingKeyValuePair_t parameter
|
|
||||||
/// </summary>
|
|
||||||
public LobbyQuery FilterStringKeyValue( MatchMakingKeyValuePair_t kv )
|
|
||||||
{
|
|
||||||
stringFilter = kv;
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -99,6 +92,7 @@ namespace Steamworks.Data
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
void ApplyFilters()
|
void ApplyFilters()
|
||||||
{
|
{
|
||||||
if ( distance.HasValue )
|
if ( distance.HasValue )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user