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?

1回答
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
回答済み 1年前
  • 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.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ