SteamServerBrowser - stingray.SteamServerBrowser object reference - Stingray Lua API Reference

stingray.SteamServerBrowser object reference

Description

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.

Functions

Parameters

self :

stingray.SteamServerBrowser

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.
Returns
This function does not return any values.
Parameters

self :

stingray.SteamServerBrowser

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.

Returns
This function does not return any values.
Parameters

self :

stingray.SteamServerBrowser

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 :

steam_server_browser_filter

A table that provides filter settings.

Returns
This function does not return any values.

Note: LAN servers cannot be filtered.

Parameters

self :

stingray.SteamServerBrowser

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.

Returns
This function does not return any values.

Note: LAN servers cannot be filtered.

Parameters

self :

stingray.SteamServerBrowser

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.
Returns
This function does not return any values.
Parameters

self :

stingray.SteamServerBrowser

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.

Returns

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.
Parameters

self :

stingray.SteamServerBrowser

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.

Returns

boolean

Returns true if data is being fetched, or false otherwise.

boolean

Returns true if the last fetch failed.

Parameters

self :

stingray.SteamServerBrowser

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.

Returns

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.

Parameters

self :

stingray.SteamServerBrowser

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.
Returns

boolean

Returns true if the list is refreshing, or false otherwise.

If you are already refreshing, refresh() will do nothing.

Parameters

self :

stingray.SteamServerBrowser

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.
Returns

integer

The number of available game servers.

Parameters

self :

stingray.SteamServerBrowser

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.

Returns

steam_server_player[]?

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.
Parameters

self :

stingray.SteamServerBrowser

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.

Returns
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.

Parameters

self :

stingray.SteamServerBrowser

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.

Returns
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.

Parameters

self :

stingray.SteamServerBrowser

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.

Returns
This function does not return any values.
Parameters

self :

stingray.SteamServerBrowser

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.

Returns
This function does not return any values.
Parameters

self :

stingray.SteamServerBrowser

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.

Returns
This function does not return any values.
Parameters

self :

stingray.SteamServerBrowser

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.

Returns

steam_server_info

A table that contains information about the specified server.

Server search constants

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 : integer

Search for servers amongst favorites.

FRIENDS : integer

Search for servers where the player's friends are.

HISTORY : integer

Search for servers amongst recently used servers.

INTERNET : integer

Search for servers on the Internet.

LAN : integer

Search for servers on the LAN.