Skip to content

bangsalvoserver/bang-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,455 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bang-server

Repository: bangsalvoserver/bang-server
Language: C++23
Visibility: Public

Overview

This is the backend server for bang.salvoserver.it, an online implementation of the game Bang! with all expansions. The server is written in modern C++ (C++23) with a focus on minimal dependencies and high performance.

Features

  • Online multiplayer game server for Bang! with all expansions
  • Written in modern C++23
  • Minimal external dependencies:
  • Some build steps require Python 3 with additional packages
  • Designed for performance and scalability

Getting Started

Prerequisites

  • Modern C++ compiler with C++23 support
  • Dependencies:
    • libuv
    • uWebSockets
    • cxxopts
    • rapidjson
    • libpng
  • Python 3 (for build/installation scripts)
  • CMake (for building the project)

Installation

  1. Clone this repository:

    git clone https://github.com/bangsalvoserver/bang-server.git
    cd bang-server
  2. Install the required C++ dependencies (refer to each library's documentation for installation).

  3. Ensure Python 3 is installed, then install Python dependencies:

    pip install pyyaml pillow
  4. Build the server using CMake:

    mkdir build
    cd build
    cmake ..
    make

    The resulting binary (e.g. bang-server) will be placed in the build directory.

Usage

After building, you can run the server with the following command-line options:

Usage: bang-server [PORT] [OPTIONS]

Positional arguments:
  PORT                      Set the server port (default: 47654)

Options:
  --cheats                  Enable cheats
  -l, --logging <level>     Set logging verbosity (e.g., info, debug, warn, error)
  -r, --reuse-addr          Allow reusing the address/port (useful for quick restarts)
  -t, --tracking-db <file>  Path to the tracking database (SQLite file).  
                            This database tracks player count and lobby count over time.
                            The database will be created automatically if missing.
  -h, --help                Print this help message and exit

TLS/SSL options (if built with SSL support):
  -s, --secure              Enable TLS/SSL mode
  --cert <file>             Path to the SSL certificate file
  --key <file>              Path to the SSL private key file

Examples:

# Start the server with default options
./bang-server

# Start on a custom port with increased logging
./bang-server 12345 --logging debug

# Start with tracking database and cheats enabled
./bang-server --tracking-db tracking.sqlite --cheats

# Start with TLS/SSL enabled (if supported)
./bang-server 12345 --secure --cert server.crt --key server.key

Tracking Database

If you specify a tracking database (via --tracking-db <file>), it must be a SQLite file.
The server will record player count and lobby count over time for monitoring and analytics purposes.
If the database file does not exist, it will be created automatically.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any proposed changes.

Community

For questions or support, please open an issue in this repository or join our Discord server.

Disclaimer

This project is an independent, fan-made implementation of the game Bang!
All rights to the original game, its rules, names, and artwork are property of dV Giochi.
We do not claim any rights to the game or its intellectual property.

About

Backend server for bang.salvoserver.it

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages