freeciv21-server
SYNOPSIS
freeciv21-server [ -f|–file <FILE> ] [ -l|–log <FILE> ] [ -p|–port <PORT> ]
[ -r|–read <FILE> ] [ -s|–saves <DIR> ] [ –ruleset <RULESET> ] [ -a|–auth ]
[ -D|–Database <FILE> ] [ -G|–Guests ] [ -N|–Newusers ] [ -h|–help ] [ -v|–version ]
DESCRIPTION
Freeciv21 is a free open source turn-based empire-building 4x strategy game, in which each player becomes the leader of a civilization. You compete against several opponents to build cities and use them to support a military and an economy. Players strive to complete an empire that survives all encounters with its neighbors to emerge victorious. Play begins at the dawn of history in 4,000 BCE.
Freeciv21 takes its roots in the well-known FOSS game Freeciv and extends it for more fun, with a revived focus on competitive multiplayer environments. Players can choose from over 500 nations and can play against the computer or other people in an active online community.
The code is maintained by the team over at Longturn.net and is based on the QT framework. The game supports both hex and square tiles and is easily modified to create custom rules.
An HTML version of this manual page along with much more information is available on our documentation website at https://longturn.readthedocs.io/.
This is the server program used to establish a Freeciv21 server. For more information on the game, refer to freeciv21-client(6).
This manual page only lists the command line arguments for the server program. For details of the directives a server administrator can use to control aspects of the server, see freeciv21-game-manual(6).
OPTIONS
The following options are accepted on the command line of the server. They may not be combined as with other
tools. For example: freeciv21-server -fp savegame.sav 5556 will not work. Instead you will need to enter
each option separately, such as, freevic21-server -s savegame.sav -p 5556.
Tip
It is generally considered a best practice to write a .sh script to run your server. This way you do not
have to remember all the command line options to use every time you run your server.
-A, --Announce <PROTO>Announce game in LAN using protocol PROTO (IPv4/IPv6/none). Default is
IPv4. Options include:IPv4,IPv6, ornone.-B, --Bind-meta <ADDR>Connect to metaserver from this address. Default will be your public IP address assigned from your internet service provider.
Note
With regard to the command line arguments concerning the metaserver, Freeciv21 does not have its own metaserver at this time and the legacy Freeciv metaserver does not support Freeciv21. This means, right now, that all commands related to the metaserver are held over from the fork from legacy Freeciv until the Longturn community creates a custom metaserver.
-b, --bind <ADDR>Listen for clients on ADDR. Default is the IP address of the server computer.
-d, --debug <LEVEL>Set debug log level (fatal/critical/warning/info/debug). Default log level is
info.-e, --exit-on-endWhen a game ends, exit instead of restarting.
-F, --FatalRaise a signal on failed assertion. An assertion is a code calculation error. With this set, the server process will SEGFAULT instead of issuing a warning message to the terminal console.
-f, --file <FILE>Load saved game FILE. Useful when wanting to restart a game.
-i, --identity <ADDR>Be known as ADDR at metaserver or LAN client.
-k, --keepKeep updating game information on metaserver even after failure. Default is not to keep updating.
-l, --log <FILE>Use FILE as logfile. Generally a very good idea when running a server.
-M, --Metaserver <ADDR>Set ADDR as metaserver address. Allows you to point to a specific metaserver instead of the default: https://meta.freeciv.org/
-m, --metaNotify metaserver and send server’s info.
-p, --port <PORT>Listen for clients on port PORT. Default is 5556 as assigned by IANA
-q, --quitidle <TIME>Quit if no players for TIME seconds.
-R, --Ranklog <FILE>Use FILE as ranking logfile. Generally a very good idea when running a server.
-r, --read <FILE>Read startup file FILE.
-S, --Serverid <ID>Sets the server id to ID.
-s, --saves <DIR>Save games to directory DIR. Generally a very good idea to save games at least every turn and depending on how long the turns are set to, to save within a turn. In the case of a server crash, restarting from a save comes in very handy.
-t, --timetrackPrints stats about elapsed time on misc tasks. Typically used to test code performance.
-w, --warningsWarn about deprecated modpack constructs.
--ruleset <RULESET>Load ruleset RULESET. Default is the Civ2Civ3 ruleset.
--scenarios <DIR>Save scenarios to directory DIR.
-a, --authEnable database authentication (requires –Database).
-D, --Database <FILE>Enable database connection with configuration from FILE.
-G, --GuestsAllow guests to login if auth is enabled. See
-N, --NewusersAllow new users to login if auth is enabled.
-h, --helpDisplay help on command line options and quits.
--help-allDisplay help including Qt specific options and quits.
-v, --versionDisplay version information and quits.
EXAMPLES
Here are some examples:
- freeciv21-server –file oldgame.sav -p 2224
Starts a server on port 2224, loading the savegame named oldgame.sav.
- freeciv21-server -R ranklog -l logfile -r start-script -f oldgame.sav.xz -p 2224
Starts a server on port 2224, loading the savegame named oldgame.sav.xz. Player ranking events are logged to ranklog, other logging events are placed in logfile. When the server first starts, it immediately executes the server settings script named start-script. See freeciv21-server-manual(6) for more information on the server settings script.
- freeciv21-server -a -D users.conf -G -N -q 60 -l logfile -s ./saves -p 2224
Starts a server on port 2224 with authentication enabled (-a, -D, -G, and -N). If no activity for 60 seconds the server will quit (-q). Logging events are placed in logfile and periodic saves are placed in the ./saves directory.
FILES
The freeciv21-server requires the default ruleset files to be readable at start.
civ2civ3/buildings.ruleset
civ2civ3/cities.ruleset
civ2civ3/effects.ruleset
civ2civ3/game.ruleset
civ2civ3/governments.ruleset
civ2civ3/nations.rulest
civ2civ3/styles.ruleset
civ2civ3/techs.ruleset
civ2civ3/terrain.ruleset
civ2civ3/units.ruleset
civ2civ3/script.lua
default/default.lua
default/nationlist.ruleset
These files are for the default ruleset for the game (civ2civ3), which are loaded if you do not use the
–ruleset argument. Alternate rules can be loaded with the rulesetdir directive in a start up script.
Type help rulesetdir at the server command prompt for more information.
If you are going to enable user authentication, you will need the database.lua file. The file is available on the GitHub repository (see below).
ENVIRONMENT
The Freeciv21 server accepts these environment variables:
- FREECIV_CAPS
A string containing a list of “capabilities” provided by the server. The compiled default should be correct for most purposes, but if you are familiar with the capability string facility in the source you may use it to enforce some constraints between clients and server.
- FREECIV_COMPRESSION_LEVEL
Sets the compression level for network traffic.
- FREECIV_MULTICAST_GROUP
Sets the multicast group (for the LAN tab).
- FREECIV_DATA_PATH
A colon separated list of directories pointing to the Freeciv21 data directories. By default Freeciv21 looks in the following directories, in order, for any data files: the current directory; the “data” subdirectory of the current directory; the subdirectory “.local/share/freeciv21” in the user’s home directory; and the directory where the files are placed by running “cmake –target install”.
- FREECIV_SAVE_PATH
A colon separated list of directories pointing to the Freeciv21 save directories. By default Freeciv21 looks in the following directories, in order, for save files: the current directory; and the subdirectory “.local/share/freeciv21/saves” in the user’s home directory.
(This does not affect where the server creates save game files. See the –saves option for that.)
- FREECIV_SCENARIO_PATH
A colon separated list of directories pointing to the Freeciv21 scenario directories. By default Freeciv21 looks in the following directories, in order, for scenario files: the current directory; the “data/scenarios” subdirectory of the current directory; the subdirectory “.local/share/freeciv21/scenarios” in the user’s home directory; and the directory where the files are placed by running “cmake –target install”.
(This does not affect where the server creates scenario files. See the –scenarios option for that.)
- HOME
Specifies the user’s home directory. For example, “””http://my_proxy_address/”””.
- http_proxy
Set this variable accordingly when using a proxy.
- LANG or LANGUAGE
Sets the language and locale on some platforms.
- LC_ALL or LC_CTYPE
Similar to LANG (see documentation for your system).
- USER
Specifies the username of the current user.
BUGS
Please report bugs to the Freeciv21 bug tracker at https://github.com/longturn/freeciv21/issues/new/choose
MORE INFORMATION
See the Longturn home page at https://longturn.net/. You can also find the code repository at https://github.com/longturn/freeciv21/.