This README covers testing and running MultiplayerSample with Amazon GameLift.
Open a command terminal from within the GameLiftLocal
directory you downloaded before, and run it with the following command:
java -jar GameLiftLocal.jar
From another terminal within the root of the MultiplayerSample project, start the server launcher (assumes the executable is the result of a profile
build):
./build/windows/bin/profile/MultiplayerSample.ServerLauncher.exe --sv_gameLiftEnabled=true --sv_dedicated_host_onstartup=false --loadlevel=NewStarbase
Note: You may be inclined to move these cvars into a cfg file and start the game by passing the --console-command-file parameter, but don't. Some cvars are used during a system component Activate(), but the console-command-file is executed after all system components have been activated. (example: sv_gameLiftEnabled is used inside AWSGameLiftServerSystemComponent::Activate()).
Create a game session with the below command:
aws gamelift create-game-session --endpoint-url http://localhost:8080 --maximum-player-session-count 2 --fleet-id fleet-123 --game-session-id hello-mps
You should observe logs in the GameLiftLocal
terminal which indicate it handled the create-game-session request, and see the ServerLauncher
load its level.
Finally, start the game launcher with the follow command:
./build/windows/bin/profile/MultiplayerSample.GameLauncher.exe --MPSGameLiftClientSystemComponent.JoinSession hello-mps --cl_gameliftLocalEndpoint "http://localhost:8080"