Recently, I was looking through the
DescribePlayerSessionsResult.h file in the GameLiftServerSDK plugin for unreal engine and noticed that the
GetPlayerSessions method returns a pointer to an array of
PlayerSession objects. However, in C/C++, it’s not possible to determine the size of an array from a pointer to one of its elements, so I was wondering if there was a way to get the number of
PlayerSession objects returned from a call to the
DescribePlayerSessions method without modifying the original plugin code? I noticed the
WithNextToken functions but I was not sure how they worked.
My use case is specifically for when a backfill request gets fulfilled successfully, and then periodically checking if there are any player sessions left in RESERVED state in the game session in order for the server to know when to make a new backfill request if needed.
Thanks in advance.