Skip to content

The server part of online multiplayer card game The Black Cat

License

Notifications You must be signed in to change notification settings

ErikCupal/the-black-cat-server

Repository files navigation

The Black Cat - Server 🎮🃏

Travis branch

The Black Cat is an online multiplayer card game. It consists of two parts: Node.js server and client app written in Kotlin and based on LibGDX game framework.

Official active servers (🔥 still under development 🔥)

Install on own server

  1. Make sure you have installed latest version of Node.js

  2. Download latest release

  3. Unzip server.zip

  4. Go to servers folder

  5. Install dependencies - run npm install command

  6. Start server by running npm run launch command. The default port is 3000. To change it run one of these commands before running npm run launch.

    • Unix (macOS/OS X/Linux): PORT=REPLACE_WITH_NUMBER
    • Windows
      • Command Line: set PORT=REPLACE_WITH_NUMBER
      • PowerShell: $env:PORT = REPLACE_WITH_NUMBER
  7. Enjoy 🃏👌

If you are using reverse proxy, make sure it has configured WebSockets support correctly. Otherwise, it might not work at all.

Alternatively, you can clone this repo and run npm run start command.

SSL/TLS support

The server fully supports secured communication, but doesn't care how you provide it. I recommend using reverse proxy to achieve it. Example configuration (nginx):

server {
  server_name sr1.theblackcat.club;

  listen 80;
  listen [::]:80;

  return 301 https://$server_name$request_uri;
}

server {
  server_name sr1.theblackcat.club;

  listen 443 ssl http2;
  listen [::]:443 ssl http2;

  # SSL certificate and configuration
  include snippets/ssl-sr1.theblackcat.club.conf;
  include snippets/ssl-params.conf;

  location / {
    proxy_pass http://localhost:9011;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
  }
}

Libraries used

And more... all listed in package.json>dependencies

How to experiment

  1. Make sure you have installed latest version of Node.js
  2. Clone the repo
  3. Install dependencies - run npm install command
  4. Make changes
  5. Build, test, lint etc. by running the right npm script. Take a look in package.json>scripts.

Future (possible features)

  • Improve bots' intelligence using machine learning (Synaptic seems like a good fit for it)

License

MIT