The SteamServerBrowser provides access to the list of game servers available on Steam.
The class keeps a list of all game servers found. Call [refresh_internet_servers()] or [refresh_lan_servers()] to refresh the list of game servers.
Constructors and accessors
Other related reference items
abort_refresh ( self )Cancels a request to refresh the server list.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. |
This function does not return any values. |
add_favorite ( self, ip, connection_port, query_port )Adds the specified server to the personal list of favorite servers, if the server is not already a favorite.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
ip : | string | The IP address of the server, in the form a.b.c.d. |
connection_port : | integer | The port that the game communicates on. |
query_port : | integer | The port that is used to query the server for information. |
This function does not return any values. |
add_filter ( self, value )Filters the list of servers using the criteria in the specified table.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
value : | A table that provides filter settings. |
This function does not return any values. |
Note: LAN servers cannot be filtered.
Other related reference items
add_filter ( self, key, value )Filters the list of servers using the specified key/value pair.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
key : | string | A key to use for filtering. May match any key in the steam_server_browser_filter table. |
value : | string | A string value to use for the specified filter key. |
This function does not return any values. |
Note: LAN servers cannot be filtered.
clear_filters ( self )Removes all previously added filters.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. |
This function does not return any values. |
data ( self, index, key ) : string?Returns the data value previously stored with the specified key on the server with the specified index.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
index : | integer | The zero-based index of the server whose data you want to retrieve within the list of servers last retrieved from the browser. |
key : | string | A string key that describes the data value you want to retrieve. |
string? |
The value stored for the key, or nil if the server keys have not yet been requested or successfully downloaded. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
is_fetching_data ( self, i ) : boolean, booleanIndicates whether or not the server data is currently being fetched, and whether or not the last fetch operation encountered an error.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
i : | integer | The zero-based index of the server within the list of servers last retrieved from the browser. |
boolean |
Returns true if data is being fetched, or false otherwise. |
boolean |
Returns true if the last fetch failed. |
is_fetching_players ( self, index ) : boolean, booleanIndicates whether or not the list of players on the specfied server are currently being fetched, and whether or not the last fetch operation encountered an error.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
index : | integer | The zero-based index of the server within the list of servers last retrieved from the browser. |
boolean |
Returns true if the player data is currently being retrieved, or false otherwise. |
boolean |
Returns true if the last retrieval failed, or false otherwise. |
is_refreshing ( self ) : booleanIndicates whether or not the list is currently refreshing.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. |
boolean |
Returns true if the list is refreshing, or false otherwise. |
If you are already refreshing, refresh() will do nothing.
num_servers ( self ) : integerReturns the number of game servers found.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. |
integer |
The number of available game servers. |
players ( self, index ) : steam_server_player[]?Returns information about the players on the server with the specified index.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
index : | integer | The zero-based index of the server whose list of players you want to retrieve within the list of servers last retrieved from the browser. |
A list that contains a separate table for each player, or nil if the list of players is being refreshed. The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Other related reference items
refresh ( self, server_type )Refreshes the server list with all servers that match the specified type.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
server_type : | integer | The type of server to search for. Can be one of the server search constants. |
This function does not return any values. |
NOTE: You cannot call this function while you have a pending request. Call [abort_request()] before, or wait for the first refresh request to finish.
Other related reference items
refresh_server ( self, i )Refresh the specifed server from the list of already fetched servers.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
i : | integer | The index of the server to refresh within the list of servers last retrieved from the browser. |
This function does not return any values. |
NOTE: You cannot call this function while you have a pending request. Call [abort_request()] before, or wait for the first refresh request to finish.
remove_favorite ( self, ip, connection_port, query_port )Removes the specified server from the personal list of favorite servers, if it is present.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
ip : | string | The IP address of the server, in the form a.b.c.d. |
connection_port : | integer | The port that the game communicates on. |
query_port : | integer | The port that is used to query the server for information. |
This function does not return any values. |
request_data ( self, i )Fetches the server data set in the game server with the specified index.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
i : | integer | The zero-based index of the server whose data you want to retrieve within the list of servers last retrieved from the browser. |
This function does not return any values. |
request_players ( self, index )Fetches the list players on the specified game server.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
index : | integer | The zero-based index of the server whose data you want to retrieve within the list of servers last retrieved from the browser. |
This function does not return any values. |
server ( self, i ) : steam_server_infoReturns information about the game server with the specified index.
|
self : | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. | |
i : | integer | The index of the server whose data you want to retrieve within the list of servers last retrieved from the browser. |
A table that contains information about the specified server. |
Other related reference items
The constants in this group enumerate the types of servers that are available.
May be used in calls to refresh() in order to filter the types of servers that you want to retrieve. All search types respect filtering except LAN.
FAVORITES : integerSearch for servers amongst favorites.
|
FRIENDS : integerSearch for servers where the player's friends are.
|
HISTORY : integerSearch for servers amongst recently used servers.
|
INTERNET : integerSearch for servers on the Internet.
|
LAN : integerSearch for servers on the LAN.
|