Represents a server node in a Steam game.
Server nodes show up in the server browser.
A server node can either be a dedicated server or a regular player that just wants his game to be visible in the server browser.
When the game server is created it doesn't have a connection with the master server so it is necessary to track the state of the server to be able to inform the server manager that the server is in a working state.
Constructors and accessors
Other related reference items
stingray.Network.shutdown_steam_server() stingray.SteamClient.server_browser() stingray.SteamPingThread() | |
Steam |
app_id ( ) : integerReturns the Steam app ID of the game the server is running.
|
This function does not accept any parameters. |
integer |
The app ID. |
data ( self, key ) : stringReturns a single string value from the data set for the 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. | |
key : | string | A key that describes the value. |
string |
The string value stored for the specified key. |
members ( self ) : string[]Returns the peer IDs of all members on the 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. |
string[] |
A table that lists the IDs of all members on the server. 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. |
name ( self, peer ) : stringReturns the name of the peer on the server, or an empty string if the peer is unknown.
|
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. | |
peer : | string | The ID of the peer whose name you want to retrieve. |
string |
The name of the peer. |
remove_member ( self, player )Removes a member from 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. | |
player : | string | The ID of the peer to remove. |
This function does not return any values. |
run_callbacks ( self, callback_object )Checks for game server events, and alerts you by calling a function of the specified callback object.
|
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. | |
callback_object : | table | An object whose functions will be invoked to alert you of events that have occurred in this frame. |
This function does not return any values. |
The following call can be made on the callback object:
set_data ( self, key, value )Sets a single key/value data pair for the server, which can be fetched by the server browser.
|
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 | The key name for the data. |
value : | string | The value corresponding to the specified key. |
This function does not return any values. |
set_data ( self, value )Sets data for the server, which can be fetched by the server browser.
|
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 : | table | A table of key/value pairs, where each key and each value is a string. |
This function does not return any values. |
set_game_tags ( self, tags )Sets game tags for the server, which players can use to find the server in the server browser.
|
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. | |
tags : | string | The game tags to set for the server. |
This function does not return any values. |
set_map ( self, map )Sets the map name on the 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. | |
map : | string | The name of the map. |
This function does not return any values. |
set_score ( self, peer, score )Sets the score for a specified peer on the 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. | |
peer : | string | The peer whose score you want to set. |
score : | integer | The score to set for the speciifed peer. |
This function does not return any values. |
The score is an integer number, which will be shown in the Steam server browser along with each player's name.
set_server_name ( self, name )Sets the server name.
|
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. | |
name : | string | The name of the server. |
This function does not return any values. |
state ( self ) : integerReturns the status of the connection with the master 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. |
integer |
The connection state, which may be any value from the connection state constants group. |
Constants that describe possible connection states when connecting to the master game server.
CONNECTED : integerIndicates that server is connected to the master server.
|
CONNECTING : integerIndicates that server is still trying to connect to the master server.
|
DISCONNECTED : integerIndicates that server has lost contact with the master server.
|