This document describes how to implement nearby resource scheduling through a game server queue.
StartGameServerSessionPlacement TencentCloud API in the code to place the game server session in the server fleet process. This example uses TencentCloud API Explorer for quick creation.
Input parameter description
Regionindicates the region, which is “ap-shanghai” (East China (Shanghai)) in this example;
PlacementIdindicates the unique ID of the game server session placement, which is 1 in this example;
GameServerSessionQueueNameindicates the game server session queue name, which is "dispatchingnearby" in this example;
MaximumPlayerSessionCountindicates the maximum number of concurrent players allowed by the game server to connect to the game session, which is 2 in this example;
DesiredPlayerSessions.Nindicates the player game session information, where
PlayerIdis the unique player ID associated with the player session. In this example, two values of 1 and 2 are entered respectively;
PlayerLatencies.Nindicates the player latency, where
PlayerIdis the player ID,
RegionIdentifieris the name of the region where the latency occurs, and
LatencyInMillisecondsis the latency in milliseconds. In this example, four value sets are entered, i.e., [1, ap-shanghai, 100], [1, na-siliconvalley, 50], [2, ap-shanghai, 60], and [2, na-siliconvalley, 80].
Latency in two players' arrival at the target address:
Since the latency policy specifies that in the first 10 seconds, servers in regions where the latency for any players is up to 80 ms will be matched first, the game server session will be scheduled to the Silicon Valley region.
Test result returned after API call:
The game server session is scheduled to server fleet 2 (US region).