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

stingray.LanLobbyBrowser object reference

Description

The LanLobbyBrowser provides access to the list of game lobbies available on the local area network (LAN).

Call refresh() to refresh the list.

Call num_lobbies() to get the number of available lobbies, and call lobby() to retrieve detailed information about each of those lobbies. You can use these details to determine if you want to join the lobby, and the IP address and port needed in order to connect.

Functions

Parameters

self :

stingray.LanLobbyBrowser

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 lobby browser is currently refreshing its list, or false otherwise.

If this function returns true, calling refresh() will have no effect.

Parameters

self :

stingray.LanLobbyBrowser

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 index number of the lobby to retrieve from the list maintained by the lobby browser.

Returns

network_lan_lobby_info

A table that contains detailed information about the specified lobby.

Parameters

self :

stingray.LanLobbyBrowser

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

Parameters

self :

stingray.LanLobbyBrowser

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.

port :

number

The port number that the network broadcast should search on.

Returns
This function does not return any values.

The search will only find LAN Lobbies configured to use a matching port number.

You can't refresh more than once every 3 seconds. If the list has been refreshed less than three seconds ago, or if the list is currently being refreshed (see is_refreshing()), calling refresh() will have no effect.