Class SteamSearchParameters
What parameters we want to use to search for lobbies with. If we create a lobby, these will be applied.
Inheritance
Namespace: KaijuSolutions.SteamMultiplayerEngine
Syntax
public sealed class SteamSearchParameters : ScriptableObject
Fields
autoPreferFriends
When automatically finding a lobby to join, should joining friends be prioritized over public lobbies? If enabled and a friend can be joined, this will join them. Otherwise, the games friends are in will still be considered alongside public matches. This is ignored if automatically matchmaking as a group, as there would otherwise be no guarantees all members of the party are friends with the owner of this lobby which could prevent them from joining.
Declaration
public bool autoPreferFriends
Field Value
Type | Description |
---|---|
System.Boolean |
distance
How far to search for lobbies.
Close - Only lobbies in the same immediate region will be returned.
Default - Only lobbies in the same region or nearby regions will be returned.
Far - For games that don't have many latency requirements, will return lobbies about half-way around the globe.
Worldwide - No filtering, will match lobbies as far as India to NY (not recommended, expect multiple seconds of latency between the clients).
Declaration
public SteamDistance distance
Field Value
Type | Description |
---|---|
SteamDistance |
players
How to handle sorting lobbies based on player counts.
Most Players - Sort by highest current player count and then by highest capacity.
None - Don't sort by player count.
Least Players - Sort by lowest current player count and then by lowest capacity.
Declaration
public SteamPopulationMode players
Field Value
Type | Description |
---|---|
SteamPopulationMode |
Properties
Assigned
Check if these parameters are currently assigned.
Declaration
public bool Assigned { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
AutoMaximum
How many lobbies at most to search for when automatically trying to find a match. This is a separate field as you may want it higher given you're not interested in displaying auto matchmaking in a UI. If set to zero, will only try to join friends before trying to host a lobby. If looking for matches for a group, at minimum at least one public match will be searched for regardless of this value, as friend matches are excluded since they may not be joinable by everyone in thr group.
Declaration
public int AutoMaximum { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Keys
Get the keys.
Declaration
public string[] Keys { get; }
Property Value
Type | Description |
---|---|
System.String[] |
Maximum
How many lobbies at most to search for. Unless your game has a lot of users, you likely don't need to set this for performance reasons. However, you likely want to limit it for your UI, whether through here or other handling of the results. If set to zero, searching for all lobbies is the same as just getting friends lobbies. If looking for matches for a group, at minimum at least one public match will be searched for regardless of this value, as friend matches are excluded since they may not be joinable by everyone in thr group.
Declaration
public int Maximum { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
NearKeys
Get the number keys.
Declaration
public string[] NearKeys { get; }
Property Value
Type | Description |
---|---|
System.String[] |
NumberKeys
Get the number keys.
Declaration
public string[] NumberKeys { get; }
Property Value
Type | Description |
---|---|
System.String[] |
StringKeys
Get the string keys.
Declaration
public string[] StringKeys { get; }
Property Value
Type | Description |
---|---|
System.String[] |
Methods
Assign()
Assign these search parameters.
Declaration
public void Assign()
Clear()
Clear all values.
Declaration
public void Clear()
ClearNear()
Clear all number values.
Declaration
public void ClearNear()
ClearNumbers()
Clear all number values.
Declaration
public void ClearNumbers()
ClearStrings()
Clear all string values.
Declaration
public void ClearStrings()
Delete(String)
Delete a value.
Declaration
public bool Delete(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it was deleted. |
DeleteNear(String)
Delete a near value.
Declaration
public bool DeleteNear(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it was deleted. |
DeleteNumber(String)
Delete a number value.
Declaration
public bool DeleteNumber(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it was deleted. |
DeleteString(String)
Delete a string value.
Declaration
public bool DeleteString(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it was deleted. |
GetKeyType(String)
Get the type of data a key is for.
Declaration
public SteamSearchKey GetKeyType(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
SteamSearchKey | The type of data the key is for. |
GetNear(String)
Get a near value.
Declaration
public SteamNearData GetNear(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
SteamNearData | The value or a new struct if it does not exist. |
GetNumber(String)
Get a number value.
Declaration
public SteamNumberData GetNumber(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
SteamNumberData | The value or a new struct if it does not exist. |
GetParameters(out SteamNumberData[], out SteamStringData[], out SteamNearData[])
Get copies of the data for external use.
Declaration
public void GetParameters(out SteamNumberData[] currentNumbers, out SteamStringData[] currentStrings, out SteamNearData[] currentNear)
Parameters
Type | Name | Description |
---|---|---|
SteamNumberData[] | currentNumbers | The numbers data. |
SteamStringData[] | currentStrings | The strings data. |
SteamNearData[] | currentNear | The near data. |
GetString(String)
Get a string value.
Declaration
public SteamStringData GetString(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
SteamStringData | The value or a new struct if it does not exist. |
Has(String)
See if a given key exists.
Declaration
public bool Has(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it exists. |
HasNear(String)
See if a given near key exists.
Declaration
public bool HasNear(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it exists. |
HasNumber(String)
See if a given number key exists.
Declaration
public bool HasNumber(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it exists. |
HasString(String)
See if a given string key exists.
Declaration
public bool HasString(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it exists. |
Search()
Add all this data to the lobby search.
Declaration
public bool Search()
Returns
Type | Description |
---|---|
System.Boolean | If everything was successfully added to the lobby search. |
Set()
Add lobby data if we are the owner.
Declaration
public bool Set()
Returns
Type | Description |
---|---|
System.Boolean | If all data was successfully set. |
SetNear(String, Int32, Int32)
Set a near value.
Declaration
public void SetNear(string key, int value = 0, int order = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Int32 | value | The value. |
System.Int32 | order | The sorting order. |
SetNumber(String, Int32, Int32, SteamSearchType)
Set a number value.
Declaration
public void SetNumber(string key, int value = 0, int order = 0, SteamSearchType searchType = SteamSearchType.Equal)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Int32 | value | The value. |
System.Int32 | order | The sorting order. |
SteamSearchType | searchType | How to handle this value. |
SetString(String, String, Int32, SteamSearchType)
Set a string value.
Declaration
public void SetString(string key, string value = null, int order = 0, SteamSearchType searchType = SteamSearchType.Equal)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.String | value | The value. |
System.Int32 | order | The sorting order. |
SteamSearchType | searchType | How to handle this value. |
Validate()
Validate the data.
Declaration
public void Validate()