Freeciv21 Manual
  • Getting
  • Playing
  • Manuals
    • Game Manual
    • Server Manual
    • Advanced Game Topics
      • Advanced Player Setup
      • Launching the Game with fc21 Links
        • Automating Login on Linux
        • Automating Login on Windows
      • Controlling the Map Generator
      • Loading Civilization 2 Files
    • Program Manual Pages
    • Using the Modpack Installer Utility
    • Common Ruleset Reference Pages
  • Modding
  • Contributing
  • Coding
  • Glossary of Terms
Freeciv21 Manual
  • Manuals
  • Advanced Game Topics
  • Launching the Game with fc21 Links
  • View page source

Launching the Game with fc21 Links

The Freeciv21 Server accepts connection requests with a fc21:// protocol handler on all platforms. This makes it possible to include login links on the Longturn.net webserver, or for games self-hosted by players.

Here is a sample from a command line:

$ ./freeciv21-client "fc21://[username]:[password]@[server]:[port]" -a -t amplio2

In this example, a player is launching the client from a command line and including the URI as the primary input. By passing [username], [password], [server], and [port] this command provides all the details needed to connect to a game. The -a enables auto-connect and -t amplio2 tells the client to load the Amplio2 tileset.

Alternately, HTML can be used in a webpage. For example:

<a href="fc21://[username]:[password]@[server]:[port]">Game Name</a>

Notice the same four parameters. The [password] parameter can be obmitted. If so, the server will prompt the user for credentials before connecting.

Note

The square brackets [ and ] are meant to be replaced. For example: [username] should be replaced with myusername. Same for the other three parameters.

Tip

Passwords containing special characters (e.g. / or @), can cause the client to exit unexpectedly without establishing a connection to the server. In this case, you must set your password as url-encoded. You can paste your password into this tool to get a url-encoded version of your password: https://www.urlencoder.io/.

Automating Login on Linux

The simplest way to automate the login process on Linux is to create a shell script with the parameters. For example:

$ nano lt-game.sh

  #!/bin/bash

  /fully/qualified/path/to/freeciv21-client "fc21://[username]:[password]@[server]:[port]" -a

$ chmod +x lt-game.sh
$ ./lt-game.sh

Alternatively, you can create a custom .desktop file for the game.

Automating Login on Windows

On Windows, you can automate the login process with a Shortcut. Start by finding the location where you installed Freeciv21. By default this is in C:\Program Files\Freeciv21. Right-click on freeciv21-client.exe and select Create Shortcut. Right-click on the new shortcut and select Properties. At the end of the path to the freeciv21-client.exe, add fc21://[username]:[password]@[server]:[port] -a and click Apply.

Note

The path to freeciv21-client.exe may be wrapped in quotation marks ("). This is typically used when there are spaces in the full path. As noted, the default install location has a space in the path, so do not be surprised to see "C:\Program Files\Freeciv21freeciv21-client.exe" in the shortcut. You do not need to continue quoting after the path to the exe. A valid shortcut target with quotation marks will look like this:

"C:\Program Files\Freeciv21\freeciv21-client.exe" fc21://[username]:[password]@[server]:[port] -a

Previous Next

© Copyright GPL-3.0-or-later, Freeciv21 and Freeciv Contributors.

Built with Sphinx using a theme provided by Read the Docs.