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?

gefragt vor einem Jahr258 Aufrufe
1 Antwort
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
beantwortet vor einem Jahr
  • 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.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen