IN THIS ARTICLE
Testing the Windows Client to Linux Server Connection
Testing the Windows Client to Linux Server Connection
This feature is in preview release and is subject to change. |
After you’ve built the Windows client and Linux server, you should test the connection to make sure that everything is running smoothly. This topic covers starting your server, getting connection information, running the remote console on Windows to manage your connection, and connecting your game client to the server.
Prerequisites
To test your server setup, complete the following tasks.
- Complete the steps in Deploy a Lumberyard multiplayer project’s server on Linux.
- Get the public IP address (not DNS name) of your Linux server.
- Get the public IP address of your client machine.
- Allow outbound TCP connections on Windows 10 to your Linux server on port
4600
, and outbound UDP connections on port33435
. If you’re not familiar with how to configure Windows firewall to allow outbound connections, see the Microsoft Windows Firewall documentation . - Allow inbound TCP connections on Linux on port
4600
, and inbound UDP connections on port33435
. If you’re using an Amazon EC2 instance, follow the instructions for Authorizing inbound traffic on Linux . If you’re running your own independent Linux server or using Windows Subsystem for Linux (WSL), read your distribution’s instructions on configuring your firewall to allow the client connection.
Important
There might be other considerations in your network environment that require additional setup – such as a corporate firewall, proxy, or VPN – that you should consult with your system administrator on as part of setting up for testing.
Start the server
Before starting the client and after configuring the server to accept connections, start the dedicated server.
To start the server
In a terminal, navigate to the
absolute_path_to_unarchive_location/dev/BinLinux64.Dedicated
directory.Copy the resources built on Windows to the build directory. To function properly, the working directory that you launch the server from needs to contain configuration information for the project and the
multiplayersample
directory containing the.pak
asset bundles.
cp -r ../MultiplayerSample_pc_Paks_Dedicated/* ./
- Make sure that the correct project is bootstrapped. Edit the
absolute_path_to_unarchive_location/dev/BinLinux64.Dedicated/bootstrap.cfg
file to ensure that the value ofsys_game_folder
is set toMultiplayerSample
.
sys_game_folder=MultiplayerSample
Note
You might see ^M
characters at the end of every line in the bootstrap.cfg
file. This indicates that the file uses Windows-style line endings rather than Linux-style ones. This doesn’t affect the ability of the Lumberyard dedicated server from loading the bootstrap file correctly, and you don’t need to worry about preserving the line ending type when you edit the file.
Start the server.
./MultiplayerSampleLauncher_Server
Configure the server remotely
When the server is running, launch the remote console and set up the server to start hosting a game session.
Launch the Remote Console on your Windows 10 machine, located at
lumberyard_install_dir\dev\Tools\RemoteConsole\RemoteConsole.exe
.In the Remote Console, Select Targets > PC, and then edit the Targets > Custom IP setting to be the IP address for your Linux server.
If the connection to the dedicated server is successful, you see a green status light and the word Connected in the lower right corner of the window. Make sure that the IP address and port, located in the lower left of the window, match up with the location of your server. If you had an instance of the client already running, the remote console will attempt to connect to it first.
In the command line located at the bottom of the window, send commands to the server to start the multiplayer session and load a map.
mphost map multiplayersample
Close the remote console.
Connect from the client to the server
Start the game client and connect to the multiplayer session.
Edit the
lumberyard_install_dir\dev\bootstrap.cfg
file and setconnect_to_remote
to1
.connect_to_remote=1
Launch the client.
- For Visual Studio 2017:
lumberyard_install_dir\dev\Bin64vc141\
- For Visual Studio 2019:
lumberyard_install_dir\dev\Bin64vc142\
- For Visual Studio 2017:
In the client, press the ``` (grave) key to open the console and enter the command
mpjoin server_ip_address.
If the connection to the game server was successful, you now have a game session running in your client. Try out connecting other clients to the server using these same steps to continue testing with multiple players!