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

stingray.SteamGameServer object reference

Description

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.

Functions

Parameters
This function does not accept any parameters.
Returns

integer

The app ID.

Parameters

self :

stingray.SteamGameServer

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.

Returns

string

The string value stored for the specified key.

Parameters

self :

stingray.SteamGameServer

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

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

self :

stingray.SteamGameServer

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.

Returns

string

The name of the peer.

Parameters

self :

stingray.SteamGameServer

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.

Returns
This function does not return any values.
Parameters

self :

stingray.SteamGameServer

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.

Returns
This function does not return any values.

The following call can be made on the callback object:

  • server_member_added(peer): Called when a new member joins the server.
Parameters

self :

stingray.SteamGameServer

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.

Returns
This function does not return any values.
Parameters

self :

stingray.SteamGameServer

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.

Returns
This function does not return any values.
Parameters

self :

stingray.SteamGameServer

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.

Returns
This function does not return any values.
Parameters

self :

stingray.SteamGameServer

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.

Returns
This function does not return any values.
Parameters

self :

stingray.SteamGameServer

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.

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

Parameters

self :

stingray.SteamGameServer

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.

Returns
This function does not return any values.
Parameters

self :

stingray.SteamGameServer

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 connection state, which may be any value from the connection state constants group.

Connection State constants

Constants that describe possible connection states when connecting to the master game server.

CONNECTED : integer

Indicates that server is connected to the master server.

CONNECTING : integer

Indicates that server is still trying to connect to the master server.

DISCONNECTED : integer

Indicates that server has lost contact with the master server.