/AWS1/IF_GML=>GETPLAYERCONNECTIONDETAILS()¶
About GetPlayerConnectionDetails¶
This API works with the following fleet types: EC2 (server SDK 5.x or later), Container
Retrieves connection details for game clients to connect to game sessions.
Player gateway benefits: DDoS protection with negligible impact to latency.
To enable player gateway on your fleet, set PlayerGatewayMode to ENABLED or REQUIRED when calling
CreateFleet or
CreateContainerFleet.
How to use: After creating a game session and adding players, call this operation with the game session ID and player IDs. When player gateway is enabled, the response includes connection endpoints and player gateway tokens that your game clients can use to connect to the game session through player gateway. To learn more about player gateway integration, see DDoS protection with Amazon GameLift Servers player gateway.
When player gateway is disabled or in locations where player gateway is not supported, this operation returns game server connection information without player gateway tokens, so that your game clients directly connect to the game server endpoint.
Method Signature¶
METHODS /AWS1/IF_GML~GETPLAYERCONNECTIONDETAILS
IMPORTING
!IV_GAMESESSIONID TYPE /AWS1/GMLARNSTRINGMODEL OPTIONAL
!IT_PLAYERIDS TYPE /AWS1/CL_GMLPLAYERIDLIST_W=>TT_PLAYERIDLIST OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_gmlgetplyrconndetsout
RAISING
/AWS1/CX_GMLINTERNALSERVICEEX
/AWS1/CX_GMLINVGAMESESSSTATEX
/AWS1/CX_GMLINVALIDREQUESTEX
/AWS1/CX_GMLLIMITEXCEEDEDEX
/AWS1/CX_GMLNOTFOUNDEXCEPTION
/AWS1/CX_GMLUNAUTHORIZEDEX
/AWS1/CX_GMLUNSUPPEDREGIONEX
/AWS1/CX_GMLCLIENTEXC
/AWS1/CX_GMLSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_gamesessionid TYPE /AWS1/GMLARNSTRINGMODEL /AWS1/GMLARNSTRINGMODEL¶
A unique identifier for the game session for which to retrieve player connection details.
it_playerids TYPE /AWS1/CL_GMLPLAYERIDLIST_W=>TT_PLAYERIDLIST TT_PLAYERIDLIST¶
List of unique identifiers for players. Connection details are returned for each player in this list.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_gmlgetplyrconndetsout /AWS1/CL_GMLGETPLYRCONNDETSOUT¶
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->getplayerconnectiondetails(
it_playerids = VALUE /aws1/cl_gmlplayeridlist_w=>tt_playeridlist(
( new /aws1/cl_gmlplayeridlist_w( |string| ) )
)
iv_gamesessionid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_arnstringmodel = lo_result->get_gamesessionid( ).
LOOP AT lo_result->get_playerconnectiondetails( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_playerid = lo_row_1->get_playerid( ).
LOOP AT lo_row_1->get_endpoints( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_ipaddress = lo_row_3->get_ipaddress( ).
lv_portnumber = lo_row_3->get_port( ).
ENDIF.
ENDLOOP.
lv_maxstring = lo_row_1->get_playergatewaytoken( ).
lv_timestamp = lo_row_1->get_expiration( ).
ENDIF.
ENDLOOP.
ENDIF.