How to convert AwsStringOutcome to FString or FName in UE5?

0

Im using Gamelift for my UE5 game and have some gamelift server sdk code init. One among them is getting the session id using Aws::GameLift::AwsStringOutcome sessionIdAWS = Aws::GameLift::Server::GetGameSessionId(). The question is how can I convert this AwsStringOutcome to Fstring or other UE datatypes so that I can use it as I want?

asked a year ago258 views
1 Answer
0

Hi!

You should be able to extract the FString from the outcome object that is returned by GetGameSessionId().

auto outcome = Aws::GameLift::Server::GetGameSessionId();
if (outcome.IsSuccess()){
   FString gameSessionId = outcome.getResult();
} else {
  // error handling goes here
}

Thanks!

AWS
answered a year ago
  • Aws::GameLift::Server::Model::DescribePlayerSessionsRequest DescribePlayerSessionsRequest; DescribePlayerSessionsRequest.SetGameSessionId(TCHAR_TO_ANSI(*sessionId)); DescribePlayerSessionsRequest.SetPlayerSessionStatusFilter("RESERVED");

    auto DescribePlayerSessionsOutcome = Aws::GameLift::Server::DescribePlayerSessions(DescribePlayerSessionsRequest); 
    

    How to forloop through this and get all player IDs for players in reserved status. This would be highly helpful thanks. I am not able to understand the syntax from the documentation.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions