pub struct Api { /* private fields */ }

Implementations

Returns the current version number of the SDK built into the server process.

Initializes the GameLift SDK. This method should be called on launch, before any other GameLift-related initialization occurs.

Notifies the GameLift service that the server process is ready to host game sessions. Call this method after successfully invoking init_sdk and completing setup tasks that are required before the server process can host a game session. This method should be called only once per process.

Notifies the GameLift service that the server process is shutting down. This method should be called after all other cleanup tasks, including shutting down all active game sessions. This method should exit with an exit code of 0; a non-zero exit code results in an event message that the process did not exit cleanly.

Notifies the GameLift service that the server process has activated a game session and is now ready to receive player connections. This action should be called as part of the on_start_game_session() callback function, after all game session initialization has been completed.

👎 Deprecated since 4.0.1:

Instead, the server process should call process_ending() after a game session has ended

Notifies the GameLift service that the server process has ended the current game session. This action is called when the server process will remain active and ready to host a new game session. It should be called only after your game session termination procedure is complete, because it signals to GameLift that the server process is immediately available to host a new game session.

This action is not called if the server process will be shut down after the game session stops. Instead, call process_ending to signal that both the game session and the server process are ending.

Updates the current game session’s ability to accept new player sessions. A game session can be set to either accept or deny all new player sessions. (See also the update_game_session() action in the GameLift Service API Reference).

Retrieves the ID of the game session currently being hosted by the server process, if the server process is active.

Returns the time that a server process is scheduled to be shut down, if a termination time is available. A server process takes this action after receiving an on_process_terminate() callback from the GameLift service. GameLift may call on_process_terminate() for the following reasons: (1) for poor health (the server process has reported port health or has not responded to GameLift, (2) when terminating the instance during a scale-down event, or (3) when an instance is being terminated due to a spot-instance interruption.

If the process has received an on_process_terminate() callback, the value returned is the estimated termination time. If the process has not received an on_process_terminate() callback, an error message is returned. Learn more about shutting down a server process.

Notifies the GameLift service that a player with the specified player session ID has connected to the server process and needs validation. GameLift verifies that the player session ID is valid—that is, that the player ID has reserved a player slot in the game session. Once validated, GameLift changes the status of the player slot from RESERVED to ACTIVE.

Notifies the GameLift service that a player with the specified player session ID has disconnected from the server process. In response, GameLift changes the player slot to available, which allows it to be assigned to a new player.

Retrieves player session data, including settings, session metadata, and player data. Use this action to get information for a single player session, for all player sessions in a game session, or for all player sessions associated with a single player ID.

Sends a request to find new players for open slots in a game session created with FlexMatch. See also the AWS SDK action start_match_backfill. With this action, match backfill requests can be initiated by a game server process that is hosting the game session. Learn more about the FlexMatch backfill feature.

This action is asynchronous. If new players are successfully matched, the GameLift service delivers updated matchmaker data using the callback function on_update_game_session().

A server process can have only one active match backfill request at a time. To send a new request, first call stop_match_backfill to cancel the original request.

Cancels an active match backfill request that was created with start_match_backfill. See also the AWS SDK action StopMatchmaking(). Learn more about the FlexMatch backfill feature.

Retrieves the file location of a pem-encoded TLS certificate that is associated with the fleet and its instances. This certificate is generated when a new fleet is created with the certificate configuration set to GENERATED. Use this certificate to establish a secure connection with a game client and to encrypt client/server communication.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more