Search/join games with queues on different regions

Hello, im having trouble trying to join an already created game via queues. I’ve made a matchmaking service which request data to gamelift, such as game creation, player joining, game searching, etc… so every client connects through this service to join games.

The service automatically attempts to find a match, but if none is found then creates a new one and returns a valid player session.

The games are being created just fine… the problem comes when i have to find a suitable game to join when the queue has assigned fleets which belongs to different regions.

The gamelift client that the service is using is created on US_EAST_1… but there is a fleet in the queue that is set in South America, so when i try to search a game in that fleet throws an exception saying that the fleet does not exist.

I read that i could create the game placement with DesiredPlayerSessions… however does player session expires over time? I mean, in my case, a game could be created and player may not join after an hour o more. Also, how could i know if the game has available player sessions after a player leaves the match?

Is there any other approach of fixing this issue?

I finally solved it by parsing region from DestinationARN returned by DescribeGameSessionQueues… then getting an AmazonGameLiftClient which is connected to this region. Finally making the request SearchGameSessions with the proper client.

Here is a sample:


// Solve queue object by name
DescribeGameSessionQueuesRequest describeQueueRequest = new DescribeGameSessionQueuesRequest();
describeQueueRequest.Names.Add(queueName);
DescribeGameSessionQueuesResponse describeQueueResponse = nclient.DescribeGameSessionQueues(describeQueueRequest);
GameSessionQueue queue = describeQueueResponse.GameSessionQueues[0];
SearchGameSessionsRequest searchGamesRequest = new SearchGameSessionsRequest();
searchGamesRequest.Limit = maxResults;
if (filters != null)
searchGamesRequest.FilterExpression = filters.Build();
if (sorting != null)
searchGamesRequest.SortExpression = sorting.Build();
// Iterate over destinations in the queue
foreach (GameSessionQueueDestination dest in queue.Destinations)
{
string[] values = dest.DestinationArn.Split(new string[] { "arn:aws:gamelift:", "::fleet/" },
StringSplitOptions.RemoveEmptyEntries);
string region = null;
// Parse region and fleet id from destination arn
if (values.Length > 0)
{
region = values[0];
if (values.Length > 1)
{
string fleet = values[1];
if (fleet.StartsWith("fleet"))
{
searchGamesRequest.FleetId = fleet;
searchGamesRequest.AliasId = null;
}
else if (fleet.StartsWith("alias"))
{
searchGamesRequest.FleetId = null;
searchGamesRequest.AliasId = fleet;
}
}
}
AmazonGameLiftClient client = SolveClientByRegion(region);
if (client != null)
{
SearchGameSessionsResponse searchGameResponse;
// This request used to throw an exception.. now it works!
searchGameResponse = client.SearchGameSessions(searchGamesRequest);
...
}
}

Hey @lorubx!

Yes, your call was not successful because you needed to make a cross region call in this case as you discovered. I had intended to reply to you yesterday and was unable to – very sorry about that, and happy to see that you were able to get yourself unblocked.