res://addons/w4gd/game_server/game_server.gd

Inherits: Node

Implements functionality specifically intended to run on a dedicated server.

Description

The most common features are exposed through res://addons/w4gd/game_server/game_server_sdk.gd,which is what you should use in most cases. Only interact with this class if you need uncommon, advanced features.

Properties

res://addons/w4gd/game_server/agones_client.gd

agones

bool

auto_shutdown_on_match_failure

true

float

health_check_interval

int

minimum_players

1

float

player_join_timeout

Methods

String

get_lobby_id ( )

Dictionary

get_lobby_properties ( )

int

get_requested_server_state ( )

int

get_server_state ( )

bool

has_lobby_metadata ( )

void

set_server_state ( int p_requested_state, Variant p_extra )


Signals

match_failed ( )

Emitted when the match can't start.


match_ready ( )

Emitted when the match is ready to start.


player_joined ( Variant peer_id, Variant player_id, Variant info )

Emitted when a new player has connected to the dedicated server.


player_left ( Variant peer_id, Variant player_id, Variant info )

Emitted when a player has disconnected from the dedicated server.


server_state_changed ( Variant new_state )

Emitted when the server state has changed.


Enumerations

enum ServerState:

ServerState UNKNOWN = 0

ServerState STARTING = 1

ServerState RESERVED = 2

ServerState READY = 3

ServerState ALLOCATED = 4

ServerState SHUTDOWN = 5


Constants

LOBBY_ID_ANNOTATION = w4games.com/lobby

The name of the Lobby ID annotation used on the Agones game server configuration.

LOBBY_PASSWORD_ANNOTATION = w4games.com/password

The name of the Lobby password annotation used on the Agones game server configuration.

LOBBY_PLAYERS_ANNOTATION = w4games.com/players

The name of the Lobby players count annotation used on the Agones game server configuration.

LOBBY_PROPS_ANNOTATION = w4games.com/props

The name of the Lobby properties annotation used on the Agones game server configuration.


Property Descriptions

res://addons/w4gd/game_server/agones_client.gd agones

Direct access to agones client for advanced use cases.


bool auto_shutdown_on_match_failure = true

Set to true to automatically shutdown if we encounter a match failure.


float health_check_interval

How often to let Agones know that we are healthy (in seconds).


int minimum_players = 1

The minimum number of players required for a match.


float player_join_timeout

How long to wait for players to connect to the dedicated server (in seconds).


Method Descriptions

String get_lobby_id ( )

Gets the Lobby ID of the match.


Dictionary get_lobby_properties ( )

Gets the Lobby properties.


int get_requested_server_state ( )

Gets the requested server state.


int get_server_state ( )

Gets the current server state.


bool has_lobby_metadata ( )

Checks if we have the required lobby metadata from the Agones game server configuration.


void set_server_state ( int p_requested_state, Variant p_extra )

Sets the requested server state.