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?

feita há um ano258 visualizações
1 Resposta
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
respondido há um ano
  • 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.

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas