Where to find a better documentation of Gamelift server SDK for Unreal Engine?

0

UpdatePlayerSessionCreationPolicy() Updates the current game session's ability to accept new player sessions. A game session can be set to either accept or deny all new player sessions. (See also the UpdateGameSession() action in the Amazon GameLift Service API Reference).

Syntax FGameLiftGenericOutcome UpdatePlayerSessionCreationPolicy(EPlayerSessionCreationPolicy policy)

I wan to set "Deny" policy in my unreal engine game once game starts. But how to implement it? The documentation in the website is dubious. Where can I get some tutorial on a proper implementation?

질문됨 일 년 전377회 조회
1개 답변
0

Hi,

The Unreal Engine UpdatePlayerSessionCreationPolicy documentation has an example of how you'd invoke this particular SDK call

FGameLiftGenericOutcome outcome = Aws::GameLift::Server::UpdatePlayerSessionCreationPolicy(Aws::GameLift::Model::EPlayerSessionCreationPolicy::ACCEPT_ALL);

In terms of when to invoke it, this would have to be custom logic within the game server itself. Once the game server has started (can be identified via the onStartGameSession callback) and the required players have joined, the server can invoke UpdatePlayerSessionCreationPolicy to prevent other players from joining. This could be built into the logic which accepts (AcceptPlayerSession) and reports new players to GameLift.

Alternatively, if the customer has a client backend service that is routing players to GameLift servers, it can update the PlayerSessionCreationPolicy using the UpdateGameSession API call when required.

Thanks!

AWS
답변함 일 년 전
  • Hi, I implemented this. however, while calling game_lift.search_game_sessions(FleetId = GAMELIFT_FLEET_ID, FilterExpression = "hasAvailablePlayerSessions=true"), the result still returns the session with policy set to deny since the players in game is less than maxplayers set. How can I exclude those sessions that do not accept further players?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠