in lambda/GameLiftUnreal-StartGameLiftSession.py [0:0]
def lambda_handler(event, context):
response = {}
# Find an game session with availability then create a new player session on it
game_session = find_available_game_session()
if (game_session is not None):
player_session = game_lift.create_player_session(GameSessionId = game_session['GameSessionId'], PlayerId = str(uuid.uuid4()))
response = player_session
else:
return {
'statusCode': 500,
'body': json.dumps('Unable to find game session, check GameLift API status')
}
return json.dumps(response, default = myconverter).encode('UTF-8')