Skip to content

/AWS1/IF_GML=>REGISTERGAMESERVER()

About RegisterGameServer

This API works with the following fleet types: EC2 (FleetIQ)

Creates a new game server resource and notifies Amazon GameLift Servers FleetIQ that the game server is ready to host gameplay and players. This operation is called by a game server process that is running on an instance in a game server group. Registering game servers enables Amazon GameLift Servers FleetIQ to track available game servers and enables game clients and services to claim a game server for a new game session.

To register a game server, identify the game server group and instance where the game server is running, and provide a unique identifier for the game server. You can also include connection and game server data.

Once a game server is successfully registered, it is put in status AVAILABLE. A request to register a game server may fail if the instance it is running on is in the process of shutting down as part of instance balancing or scale-down activity.

Learn more

Amazon GameLift Servers FleetIQ Guide

Method Signature

METHODS /AWS1/IF_GML~REGISTERGAMESERVER
  IMPORTING
    !IV_GAMESERVERGROUPNAME TYPE /AWS1/GMLGAMESERVERGRNAMEORARN OPTIONAL
    !IV_GAMESERVERID TYPE /AWS1/GMLGAMESERVERID OPTIONAL
    !IV_INSTANCEID TYPE /AWS1/GMLGAMESERVERINSTANCEID OPTIONAL
    !IV_CONNECTIONINFO TYPE /AWS1/GMLGAMESERVERCONNINFO OPTIONAL
    !IV_GAMESERVERDATA TYPE /AWS1/GMLGAMESERVERDATA OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_gmlreggameserverout
  RAISING
    /AWS1/CX_GMLCONFLICTEXCEPTION
    /AWS1/CX_GMLINTERNALSERVICEEX
    /AWS1/CX_GMLINVALIDREQUESTEX
    /AWS1/CX_GMLLIMITEXCEEDEDEX
    /AWS1/CX_GMLUNAUTHORIZEDEX
    /AWS1/CX_GMLCLIENTEXC
    /AWS1/CX_GMLSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_gameservergroupname TYPE /AWS1/GMLGAMESERVERGRNAMEORARN /AWS1/GMLGAMESERVERGRNAMEORARN

A unique identifier for the game server group where the game server is running.

iv_gameserverid TYPE /AWS1/GMLGAMESERVERID /AWS1/GMLGAMESERVERID

A custom string that uniquely identifies the game server to register. Game server IDs are developer-defined and must be unique across all game server groups in your Amazon Web Services account.

iv_instanceid TYPE /AWS1/GMLGAMESERVERINSTANCEID /AWS1/GMLGAMESERVERINSTANCEID

The unique identifier for the instance where the game server is running. This ID is available in the instance metadata. EC2 instance IDs use a 17-character format, for example: i-1234567890abcdef0.

Optional arguments:

iv_connectioninfo TYPE /AWS1/GMLGAMESERVERCONNINFO /AWS1/GMLGAMESERVERCONNINFO

Information that is needed to make inbound client connections to the game server. This might include the IP address and port, DNS name, and other information.

iv_gameserverdata TYPE /AWS1/GMLGAMESERVERDATA /AWS1/GMLGAMESERVERDATA

A set of custom game server properties, formatted as a single string value. This data is passed to a game client or service when it requests information on game servers.

RETURNING

oo_output TYPE REF TO /aws1/cl_gmlreggameserverout /AWS1/CL_GMLREGGAMESERVEROUT

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->registergameserver(
  iv_connectioninfo = |string|
  iv_gameserverdata = |string|
  iv_gameservergroupname = |string|
  iv_gameserverid = |string|
  iv_instanceid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_gameserver = lo_result->get_gameserver( ).
  IF lo_gameserver IS NOT INITIAL.
    lv_gameservergroupname = lo_gameserver->get_gameservergroupname( ).
    lv_gameservergrouparn = lo_gameserver->get_gameservergrouparn( ).
    lv_gameserverid = lo_gameserver->get_gameserverid( ).
    lv_gameserverinstanceid = lo_gameserver->get_instanceid( ).
    lv_gameserverconnectioninf = lo_gameserver->get_connectioninfo( ).
    lv_gameserverdata = lo_gameserver->get_gameserverdata( ).
    lv_gameserverclaimstatus = lo_gameserver->get_claimstatus( ).
    lv_gameserverutilizationst = lo_gameserver->get_utilizationstatus( ).
    lv_timestamp = lo_gameserver->get_registrationtime( ).
    lv_timestamp = lo_gameserver->get_lastclaimtime( ).
    lv_timestamp = lo_gameserver->get_lasthealthchecktime( ).
  ENDIF.
ENDIF.