Is there an event for game session termination?

0

Hello! I'm trying to migrate my current dedicated server from playfab to gamelift, and Playfab had an event for session closing, that I could catch in cloud code. I've used this to handle reconnecting of players who had some network issues/crashing. So far I've found nothing similar in gamelift. Is there a way to get an event out to lambda or SNS every time a game session closes (for any reason, ended, crashed, terminated, all need to be caught)?

Thank you!

질문됨 2년 전757회 조회
6개 답변
0
수락된 답변

Hi @REDACTEDUSER

Sorry for the late reply. GameLift logs process abnormal termination in fleet events (accessible via DescribeFleetEvents, e.g. SERVER_PROCESS_CRASHED, see [doc](https://docs.aws.amazon.com/id_id/cli/latest/reference/gamelift/describe-fleet-******

So, you can poll DescribeFleetEvent to see whether game session has crashed. Hopefully this suffices your use case in the short term. We currently do not offer fleet events in SNS, but this has been requested in the past and is being tracked in our backlog.

#14510

답변함 2년 전
0

When calling InitSDK in your server, it takes in a parameter of type ProcessParameters, which takes in a handler function called onProcessTerminate that I believe fits your needs in this situation. For more info, check https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-server-sdk-cpp-ref-datatypes.html#integration-server-sdk-cpp-ref-dataypes-process

답변함 2년 전
0

Thank you for your answer, but it doesn't fit my need. In case of process crashing, it cannot catch it. The gamelift service itself knows when a game is terminated, because it can gather logs, and upload them on s3, I believe, so I was wondering if there is an event there I could catch.

답변함 2년 전
0

Would also like to know if there's an event similar to the FlexMatch or placement events that can trigger when a game session is terminated. Currently we're invoking a lambda on termination from the game script, but crashes are indeed a problem. We're currently tracking our player's status (playing/idle), and if a player is attempting an API call (for example, start matchmaking) when they're already in playing state, we're polling gamelift via describe player session to see if it shows as terminated and if it is, then we're assuming that the gamescript has crashed

답변함 2년 전
0

Thanks for the reply!

Using the other API polling calls is discouraged, is that similar for this one? Is there a limit on the frequency of calling DescribeFleetEvent?

@REDACTEDUSER

process.on('uncaughtException', function(error) { InvokeSessionCompletionListenerLambda(); });

process.on('unhandledRejection', function(reason, p){ InvokeSessionCompletionListenerLambda(); });

답변함 2년 전
0

Using the other API polling calls is discouraged, is that similar for this one?

That would be the case if there is a better alternative using push. Also, different from DescribeMatchmaking, DescribeGameSessionPlacement or DescribeGameSession, (which are the 3 APIs that customers incorrectly poll the most) which are not scalable to poll because you'd hit a bottleneck beyond a certain point as your game grows. However, since there is only limited number of fleet regardless of how large your game is, polling DescribeFleetEvent is reasonably scalable.

답변함 2년 전

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

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

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

관련 콘텐츠