FAForever / server

The servercode for the Forged Alliance Forever lobby
http://www.faforever.com
GNU General Public License v3.0
67 stars 62 forks source link
game game-server hacktoberfest rts

FA Forever - Server

Build Status codecov Codacy Badge docs license python

This is the source code for the Forged Alliance Forever lobby server.

Overview

The lobby server is the piece of software sitting at the very core of FAF, enabling players to discover and play games with each other. It is a stateful TCP server written in asyncio and implements a custom TCP protocol for communicating with clients. The main responsibilities of the lobby server are:

Support development

Post a bounty on Issue Hunt. You can reward and financially help developers who work on your issue.

Issue hunt

Major Software Dependencies

The lobby server integrates with a few external services and has been tested with the following versions:

Contributing

Before opening a pull request, please take a moment to look over the contributing guidelines.

Setting up for development

For detailed instructions see the development guide.

Quickstart

This section assumes you have the necessary system dependencies installed. For a list of what those are see the development guide.

  1. Start up an instance of the FAF database. This is required to run the unit tests and development server.

    $ git clone https://github.com/FAForever/faf-stack.git
    $ cd faf-stack
    $ ./scripts/init-db.sh
  2. Install the project dependencies with pipenv

    $ pipenv sync --dev
  3. Run the unit tests or development server

    $ pipenv run tests
    $ pipenv run devserver

Network Protocol

NOTE: This section of the README is outdated. The QString based message format has been deprectaed and will be replaced by a UTF-8 json + newline format in version 2. Many commands are missing from here. For a more complete list see https://faforever.github.io/server/.

The protocol is mainly JSON-encoded maps, containing at minimum a command key, representing the command to dispatch.

The wire format uses QDataStream (UTF-16, BigEndian).

For the lobbyconnection, each message is of the form:

ACTION: QString

With most carrying a footer containing:

LOGIN: QString
SESSION: QString

Incoming Packages

Mod Vault
Social
Avatar
ICE Servers

Parties

Misc

Stream (Deprecated)

The stream API is deprecated, but currently the following message types are supported: