- 最新
- 投票最多
- 评论最多
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)
cd C:\Amazon\GameLift_04_16_2020\GameLiftLocal-1.0.5
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 http://localhost:9080
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-******
aws gamelift create-game-session --endpoint-url http://localhost:9080 --maximum-player-session-count 2 --fleet-******
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:******
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 http://localhost:9080
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.
相关内容
- AWS 官方已更新 9 个月前
- AWS 官方已更新 2 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前