- Newest
- Most votes
- Most comments
To receive FlexMatch event notifications in your Unity client app, you'll need to implement a solution that bridges the gap between AWS SNS and your client application. The SNS topic itself doesn't directly push notifications to your game clients.
Here's how you can approach this:
- Lambda Function Implementation: The FlexMatchEventHandlerLambdaFunction mentioned in the documentation should process the matchmaking events from SNS and relay them to your clients. This Lambda function could:
- Store event data in a database like DynamoDB
- Send updates to your clients via WebSockets
- Trigger other services that can communicate with your clients
- Client Communication Options:
- WebSockets: Set up an AWS API Gateway with WebSocket support, where your Lambda pushes messages that clients can subscribe to
- Client Polling: Have your Unity app periodically check a database or API endpoint that's updated by the Lambda
- Push Notifications: For mobile games, you could use mobile push notification services
- Unity Implementation: In your Unity client, you'll need to:
- Implement WebSocket connections if using that approach
- Or create polling mechanisms to check for updates
- Handle and process the matchmaking events when received
As a backup strategy, you should also implement periodic polling for status updates if a significant period passes without notifications. Wait at least 30 seconds after ticket submission or the last notification before polling, and poll no more than once every 10 seconds to minimize impact on matchmaking performance.
This approach is highly scalable compared to having clients directly call the Describe APIs repeatedly. For high-volume matchmaking, event-based architectures are strongly recommended over continuous polling.
Sources
Configure a topic subscription to invoke a Lambda function - Amazon GameLift Servers
Set up FlexMatch event notifications - Amazon GameLift Servers
Track matchmaking events - Amazon GameLift Servers
Development phase steps for successful launches on Amazon GameLift Servers | AWS for Games Blog
Relevant content
- asked 2 years ago
- asked 6 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 10 months ago
