FAForever/server

Created Apr 8, 2022 · View the FAForever/server repository page

The servercode for the Forged Alliance Forever lobby

Want this for your repo?

Render a free sample of any GitHub repo in seconds.

Visualize your own →

Contributors

48

Lines of Code

7,308

From

Oct 18, 2014

To

Apr 2, 2022

About FAForever/server

The FAForever server is the core backend infrastructure for Forged Alliance Forever, a community-maintained online multiplayer platform for the real-time strategy game Supreme Commander: Forged Alliance. Built in Python using asyncio, it implements a stateful TCP server that manages the entire player experience, from game discovery and matchmaking to rating calculations and player progression. The server maintains lists of online players, orchestrates game joins, and facilitates initial connection establishment between players who then play peer-to-peer on their own machines rather than on centralized game servers.

The server implements a two-layer custom protocol for client communication: a wire format that serializes application messages as JSON objects separated by newlines, and an application layer of request-response and asynchronous broadcast commands that synchronize game state, player information, and lobby activity. Clients can be built against this documented protocol, with the official FAF client serving as the reference implementation. The design emphasizes backwards compatibility by requiring clients to ignore unrecognized messages and fields, allowing the server to add new features without breaking older clients.

In production, the lobby server runs behind a websocket bridge written in Rust, and integrates with MariaDB for persistent data storage and optionally RabbitMQ for message queueing. The project includes comprehensive Python API documentation, unit tests, and development guides. It is part of a larger FAForever ecosystem that also includes the game mod, official client, and related tools.

Share this video

More from FAForever

See all →