GameLift local is a local simulation of GameLift that enables you to test most parts of GameLift outside of FlexMatch and process termination (both are highly requested features that hopefully will get added some day).
You should be able to easily test:
- Server initialization
- Game session creation
- Player connecting with that game session.
For example I do the following all the time (all cribbed from here: https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-testing-local.html)
Start GameLift local (note am using port 9080, defaults to 8080 if -p is not provided)
java -jar GameLiftLocal.jar -p 9080
Start my server (in this case I’m using Lumberyard so I tell it the port to use; ignore the rest of the params as they aren’t important. Note: If your server needs to call GameLift then it needs to override the client config to be the local endpoint
MultiplayerSampleLauncher_Server.exe +sv_port 33435 +gamelift_start_server +map MultiplayerSample
Now in Lumberyard local I should see my server connect, call InitSDK and ProcessReady and my server is now ready to host a game session.
Now am going to place a session on gamelift local; not fleet id is immaterial here can be anything
aws gamelift describe-game-sessions --endpoint-url --endpoint-url http://localhost:9080 --fleet-id 1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d --region us-west-2
aws gamelift create-game-session --endpoint-url http://localhost:9080 --maximum-player-session-count 2 --fleet-id fleet-1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d --region us-west-2
Should see GameLift local calling OnGameSession hooks in my local server and server than calling ActiveGameSession when ready. Returns the game session id
Create a player session if required (using game session id from create game session call)
aws gamelift create-player-session --game-session-id "arn:aws:gamelift:local::gamesession/fleet-1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d/gsess-abb00eeb-c8c4-41d5-8dcf-b4a2f03c4fc9" --player-id 12345 --endpoint-url--endpoint-url http://localhost:9080 --region us-west-2
How you test client/server connection is then up to you’ve wired getting game session/player session ids to your client.
If you client needs to call GameLift to get this information (ie describe game session/player id) then you’ll need to overide its client config to talk to GameLift etc
Your client at this point should get the ip address of the session and its port and connect via its normal route. If your client is failing at this point, check all the normal client/server connection troubleshooting spots:
- Your server is listening on the port that it reported in ProcessParameters
- Your game session is reported to be on that port
- The client is using the right port
- If you are using TLS/OpenSSL you have your certs correctly installed for communication
- Your server is accepting connections etc.