As of January 2023, the server code cannot be properly run under most common distributions, in a server environment. The reason behind this has to do, with the bleeding edge dependencies the server code uses, particularly Qt dependencies.

This guide will assume an Arch Linux environment.

Download

Download the server version of the latest compilation of the game. You may find the download under the Releases page


Installing the dependencies

Install the Qt dependencies of the game, such as:

sudo pacman -Syu qt6-base
sudo pacman -Syu qt6-multimedia
sudo pacman -Syu openssl
sudo pacman -Syu sqlite

Under certain environments, it might not be possible to install the Qt dependencies with the commands above. In such case you may also install it with aqt a CLI installer of Qt

Depending on the version of the game server you are trying to run, these dependencies might change or require more installations. Consult the source code and on Github, in case you run into issues.

Running the server

Once you have installed the server's dependencies, you may run the executable. As of January 2023, the location of the binary is at

~/Commander_Wars_Release/bin/

Upon first running, the game will create a file Commander_Wars.ini. This file contains the configuration needed to run the server. In particular these are relevant to the configuration of the server:

Notice: These parameters can also be set with IPv6

[Network]
GamePort=9001
SecondaryServerAdress=127.0.0.1
Server=true
ServerAdress=127.0.0.1
ServerListenAdress=
ServerPort=9002
ServerSecondaryListenAdress=
SlaveDespawnTime=30
SlaveHostOptions="127.0.0.1&&10000&20000;127.0.0.1&&50000&65535"
SlaveListenAdress=
SlaveServerPort=9003

The SlaveDespawnTime is the time given in seconds, before an inactive match is liberated from the RAM of the server. As of January of 2023, there is a work in progress, to allow inactive matches, to be activated again, letting players to continue a previously despawned match.

GamePort and Serverport must be allowed under the firewall options of your server to allow the communication with the clients.

SlavehostOptions lets you set the range of ports through which the clients can connect, thus allowing each new match to be hosted under a new port.

Parameter && in 127.0.0.1&&10000&20000 allows setting the first port and the & allows setting the last port. Finally a ; allows another IP(s) and port ranges to be set.

Email configuration

The server allows password reset, through e-mail. The parameters passed to the client execution can be as follows:

./Commander_Wars_Release/bin/commander_wars -mailServerAddress smtp.gmail.com -mailServerPort 465 -mailServerConnectionType SSL -mailServerUsername dummy -mailServerPassword dummy -mailServerSendAddress dummy@gmail.com -mailServerAuthMethod Login

Verify with your e-mail provider the values of the parameters.

mailServerConnectionType Can be: TLS, TCP, SSL.

mailServerAuthMethod Can be: Plain, Login.

It is recommended, that you test out the e-mails through a service such as Mailtrap

Using specific Qt versions

There are instances where testing out the server with newer versions of Qt, might be beneficial. It is possible to do so with:

LD_LIBRARY_PATH="/path/to/qt/gcc_64/lib" ./commander_wars

This is particularly beneficial, when upgrading the server or Qt versions.

Installing Mods

Once you run the server code for the first time, the game will automatically create a mods folder. In this folder you may copy the mods created by the community. Unlike the client version of the game, the server does not need the images or music. Ideally to save space you will want to remove these files before uploading them. Transfer the files through sftp or wget. Alternatively, you may consider using a CPanel like software to handle uploads of files.

Reporting issues

As of now, the issues can be directly reported through the github Issues Page open one up, in case there are glitches or bugs found.