Giter VIP home page Giter VIP logo

ab-server's Introduction

ab-server

Game server.

Docs:

Installation

Requirements:

  • Node.js 12.
  • uWebSockets.js is C++ lib and distributed in binary files for the most popular operation systems, so it is unlikely, but you may have to compile it from source if you use an unpopular OS.

Development:

npm i
cp .env.example .env

Set SU_PASSWORD variable value.

Build

npm run build:dev

or watch

npm run watch

And start

npm run start

Settings

Available environment variables.

User accounts

User accounts data are stored in ./data/user-stats.json and in memory during the server run. Set USER_ACCOUNTS to false to turn user accounts off.

Each user session is signed by the login server (Ed25519). Validation uses the public key, which is downloaded when the server starts. To change the default key server URL set AUTH_LOGIN_SERVER_KEY_URL variable value (only https is supported).

Accounts synchronization (powered by airmash.online sync service) between server instances is disabled by default. See STATS_SYNC.

Moderation Panel

The server exports a /admin URL to allow privileged players to moderate the game, and a public log to allow everyone to see moderation actions.

Add passwords to admin/passwords.txt like so:

wight:somepasswordforwight

The username is only used to enter a name into the log.

Set MODERATION_PANEL to false to turn moderation panel off. To change panel URL set MODERATION_PANEL_URL_ROUTE variable value (admin by default).

"How to run" examples

Docker

.env.production is default .env file for docker image.

  1. Build an image. docker build --target production-image --pull -t airbattle-server .

  2. Run. Don't forget to pass envirounment variables and mount the volumes you need. Example:

    docker run -v /host/logs:/app/logs -v /host/data:/app/data -p 3501:3501 -e SERVER_TYPE=FFA -e SU_PASSWORD=mypass airbattle-server

    If you want to use TLS also mount /app/certs to the host directory with privkey.pem, fullchain.pem and dhparam.pem, and set ENDPOINTS_TLS=true.

Use development-image stage to build development image.

Run directly or behind the proxy

cp .env.production .env
npm i
npm run build
npm prune --production
node ./dist/app.js

or use some kind of process managers.

If you run the server behind the proxy it is important to pass the real IP to the server (X-Real-IP or X-Forwarded-For header).

Contribution

  1. Server performance is important. Some bots (like https://github.com/airmash-refugees/airmash_bot) generate many packets espesially in -follow me mode, you can use them to test.
  2. There are eslint rules here, please don't forget about this.

ab-server's People

Contributors

blackcrawler avatar congratulatio avatar lgg avatar wight-airmash avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.