JavaScript Challenge Server to play the Swiss card game Jass (Schieber)
Switch branches/tags
develop feature/live-game-fixes feature/migrate-to-redux feature/prevent-playing-multiple-cards feature/show-winning-team-properly feature/tournament-logging greenkeeper/babel-core-6.26.0 greenkeeper/babel-eslint-8.0.0 greenkeeper/babel-eslint-8.0.1 greenkeeper/babel-eslint-8.0.2 greenkeeper/babel-eslint-8.0.3 greenkeeper/babel-eslint-8.1.0 greenkeeper/babel-eslint-8.1.1 greenkeeper/babel-eslint-8.1.2 greenkeeper/babel-eslint-8.2.0 greenkeeper/babel-eslint-8.2.1 greenkeeper/babel-eslint-8.2.2 greenkeeper/babel-eslint-8.2.3 greenkeeper/babel-eslint-8.2.4 greenkeeper/babel-eslint-8.2.5 greenkeeper/babel-eslint-8.2.6 greenkeeper/babel-polyfill-6.26.0 greenkeeper/babelify-8.0.0 greenkeeper/browserify-14.5.0 greenkeeper/browserify-15.0.0 greenkeeper/browserify-15.1.0 greenkeeper/browserify-15.2.0 greenkeeper/browserify-16.0.0 greenkeeper/browserify-16.1.0 greenkeeper/browserify-16.1.1 greenkeeper/browserify-16.2.0 greenkeeper/browserify-16.2.1 greenkeeper/chai-4.1.1 greenkeeper/chai-4.1.2 greenkeeper/chalk-2.1.0 greenkeeper/chalk-2.2.0 greenkeeper/chalk-2.2.2 greenkeeper/chalk-2.3.0 greenkeeper/chalk-2.3.1 greenkeeper/chalk-2.3.2 greenkeeper/chalk-2.4.0 greenkeeper/chalk-2.4.1 greenkeeper/copyfiles-2.0.0 greenkeeper/cross-env-5.0.2 greenkeeper/cross-env-5.0.3 greenkeeper/cross-env-5.0.4 greenkeeper/cross-env-5.0.5 greenkeeper/cross-env-5.1.0 greenkeeper/cross-env-5.1.1 greenkeeper/cross-env-5.1.2 greenkeeper/cross-env-5.1.3 greenkeeper/cross-env-5.1.4 greenkeeper/cross-env-5.1.5 greenkeeper/cross-env-5.1.6 greenkeeper/cross-env-5.2.0 greenkeeper/eslint-4.3.0 greenkeeper/eslint-4.4.0 greenkeeper/eslint-4.4.1 greenkeeper/eslint-4.5.0 greenkeeper/eslint-4.6.0 greenkeeper/eslint-4.6.1 greenkeeper/eslint-4.7.0 greenkeeper/eslint-4.7.1 greenkeeper/eslint-4.7.2 greenkeeper/eslint-4.8.0 greenkeeper/eslint-4.9.0 greenkeeper/eslint-4.10.0 greenkeeper/eslint-4.11.0 greenkeeper/eslint-4.12.0 greenkeeper/eslint-4.12.1 greenkeeper/eslint-4.13.0 greenkeeper/eslint-4.13.1 greenkeeper/eslint-4.14.0 greenkeeper/eslint-4.15.0 greenkeeper/eslint-4.16.0 greenkeeper/eslint-4.17.0 greenkeeper/eslint-4.18.0 greenkeeper/eslint-4.18.1 greenkeeper/eslint-4.18.2 greenkeeper/eslint-4.19.0 greenkeeper/eslint-4.19.1 greenkeeper/eslint-5.0.0 greenkeeper/eslint-5.0.1 greenkeeper/eslint-plugin-import-2.6.0 greenkeeper/eslint-plugin-import-2.8.0 greenkeeper/eslint-plugin-import-2.9.0 greenkeeper/eslint-plugin-import-2.10.0 greenkeeper/eslint-plugin-import-2.11.0 greenkeeper/eslint-plugin-import-2.12.0 greenkeeper/eslint-plugin-import-2.13.0 greenkeeper/eslint-plugin-react-7.2.0 greenkeeper/eslint-plugin-react-7.2.1 greenkeeper/eslint-plugin-react-7.3.0 greenkeeper/eslint-plugin-react-7.4.0 greenkeeper/eslint-plugin-react-7.5.0 greenkeeper/eslint-plugin-react-7.5.1 greenkeeper/eslint-plugin-react-7.6.0 greenkeeper/eslint-plugin-react-7.6.1 greenkeeper/eslint-plugin-react-7.7.0 greenkeeper/eslint-plugin-react-7.8.0 greenkeeper/eslint-plugin-react-7.8.1 greenkeeper/eslint-plugin-react-7.8.2 greenkeeper/eslint-plugin-react-7.9.0 greenkeeper/eslint-plugin-react-7.9.1 greenkeeper/eslint-plugin-react-7.10.0 greenkeeper/express-5.0.0-alpha.6 greenkeeper/flux-3.1.3 greenkeeper/karma-1.7.1 greenkeeper/karma-2.0.0 greenkeeper/karma-2.0.2 greenkeeper/karma-2.0.3 greenkeeper/karma-2.0.4 greenkeeper/karma-browserify-5.1.2 greenkeeper/karma-browserify-5.1.3 greenkeeper/karma-browserify-5.2.0 greenkeeper/karma-browserify-5.3.0 greenkeeper/karma-mocha-reporter-2.2.4 greenkeeper/karma-mocha-reporter-2.2.5 greenkeeper/less-3.0.0-alpha.3 greenkeeper/less-3.0.0 greenkeeper/less-3.0.1 greenkeeper/less-3.0.2 greenkeeper/less-3.0.4 greenkeeper/less-3.5.0 greenkeeper/less-3.5.1 greenkeeper/less-3.5.2 greenkeeper/less-3.5.3 greenkeeper/less-3.6.0 greenkeeper/less-3.7.0 greenkeeper/less-3.7.1 greenkeeper/less-3.8.0 greenkeeper/lodash-4.17.5 greenkeeper/mocha-3.5.0 greenkeeper/mocha-3.5.1 greenkeeper/mocha-3.5.2 greenkeeper/mocha-3.5.3 greenkeeper/mocha-4.0.0 greenkeeper/mocha-4.0.1 greenkeeper/mocha-4.1.0 greenkeeper/mocha-5.0.0 greenkeeper/mocha-5.0.1 greenkeeper/mocha-5.0.2 greenkeeper/mocha-5.0.3 greenkeeper/mocha-5.0.4 greenkeeper/mocha-5.0.5 greenkeeper/mocha-5.1.0 greenkeeper/mocha-5.1.1 greenkeeper/mocha-5.2.0 greenkeeper/monorepo.react-16.4.1 greenkeeper/nodemon-1.11.1 greenkeeper/nodemon-1.12.0 greenkeeper/nodemon-1.12.1 greenkeeper/nodemon-1.12.2 greenkeeper/nodemon-1.12.3 greenkeeper/nodemon-1.12.4 greenkeeper/nodemon-1.12.5 greenkeeper/nodemon-1.12.6 greenkeeper/nodemon-1.12.7 greenkeeper/nodemon-1.13.0 greenkeeper/nodemon-1.13.1 greenkeeper/nodemon-1.13.2 greenkeeper/nodemon-1.13.3 greenkeeper/nodemon-1.14.0 greenkeeper/nodemon-1.14.1 greenkeeper/nodemon-1.14.2 greenkeeper/nodemon-1.14.3 greenkeeper/nodemon-1.14.4 greenkeeper/nodemon-1.14.5 greenkeeper/nodemon-1.14.6 greenkeeper/nodemon-1.14.7 greenkeeper/nodemon-1.14.8 greenkeeper/nodemon-1.14.9 greenkeeper/nodemon-1.14.10 greenkeeper/nodemon-1.14.11 greenkeeper/nodemon-1.14.12 greenkeeper/nodemon-1.15.0 greenkeeper/nodemon-1.15.1 greenkeeper/nodemon-1.16.0 greenkeeper/nodemon-1.16.1 greenkeeper/nodemon-1.17.0 greenkeeper/nodemon-1.17.1 greenkeeper/nodemon-1.17.2 greenkeeper/nodemon-1.17.3 greenkeeper/nodemon-1.17.4 greenkeeper/nodemon-1.17.5 greenkeeper/nodemon-1.18.0 greenkeeper/nodemon-1.18.1 greenkeeper/nodemon-1.18.2 greenkeeper/nodemon-1.18.3 greenkeeper/npm-run-all-4.1.0 greenkeeper/npm-run-all-4.1.1 greenkeeper/npm-run-all-4.1.2 greenkeeper/npm-run-all-4.1.3 greenkeeper/phantomjs-prebuilt-2.1.15 greenkeeper/phantomjs-prebuilt-2.1.16 greenkeeper/react-15.6.2 greenkeeper/react-16.0.0 greenkeeper/react-16.1.0 greenkeeper/react-16.1.1 greenkeeper/react-16.2.0 greenkeeper/react-16.3.0 greenkeeper/react-16.3.1 greenkeeper/react-16.3.2 greenkeeper/react-16.4.0 greenkeeper/react-addons-css-transition-group-15.6.2 greenkeeper/react-addons-test-utils-15.6.2 greenkeeper/react-dom-15.6.2 greenkeeper/react-dom-16.0.0 greenkeeper/react-dom-16.1.0 greenkeeper/react-dom-16.1.1 greenkeeper/react-dom-16.2.0 greenkeeper/react-dom-16.3.0 greenkeeper/react-dom-16.3.1 greenkeeper/react-dom-16.3.2 greenkeeper/react-dom-16.4.0 greenkeeper/request-2.82.0 greenkeeper/request-2.83.0 greenkeeper/request-2.84.0 greenkeeper/request-2.85.0 greenkeeper/request-2.86.0 greenkeeper/request-2.87.0 greenkeeper/rimraf-2.6.2 greenkeeper/sinon-2.3.6 greenkeeper/sinon-2.4.0 greenkeeper/sinon-2.4.1 greenkeeper/sinon-3.0.0 greenkeeper/sinon-3.1.0 greenkeeper/sinon-3.2.0 greenkeeper/sinon-3.2.1 greenkeeper/sinon-3.3.0 greenkeeper/sinon-4.0.0 greenkeeper/sinon-4.0.1 greenkeeper/sinon-4.0.2 greenkeeper/sinon-4.1.0 greenkeeper/sinon-4.1.1 greenkeeper/sinon-4.1.2 greenkeeper/sinon-4.1.3 greenkeeper/sinon-4.1.4 greenkeeper/sinon-4.1.5 greenkeeper/sinon-4.1.6 greenkeeper/sinon-4.2.0 greenkeeper/sinon-4.2.1 greenkeeper/sinon-4.2.2 greenkeeper/sinon-4.2.3 greenkeeper/sinon-4.3.0 greenkeeper/sinon-4.4.0 greenkeeper/sinon-4.4.1 greenkeeper/sinon-4.4.2 greenkeeper/sinon-4.4.3 greenkeeper/sinon-4.4.4 greenkeeper/sinon-4.4.5 greenkeeper/sinon-4.4.6 greenkeeper/sinon-4.4.7 greenkeeper/sinon-5.0.0 greenkeeper/sinon-5.0.1 greenkeeper/sinon-5.0.2 greenkeeper/sinon-5.0.3 greenkeeper/sinon-5.0.5 greenkeeper/sinon-5.0.6 greenkeeper/sinon-5.0.7 greenkeeper/sinon-5.0.8 greenkeeper/sinon-5.0.9 greenkeeper/sinon-5.0.10 greenkeeper/sinon-5.1.0 greenkeeper/sinon-5.1.1 greenkeeper/sinon-6.0.0 greenkeeper/sinon-6.0.1 greenkeeper/socket.io-client-2.0.4 greenkeeper/socket.io-client-2.1.0 greenkeeper/socket.io-client-2.1.1 greenkeeper/update-to-node-10 greenkeeper/validate.js-0.12.0 greenkeeper/watchify-3.10.0 greenkeeper/watchify-3.11.0 greenkeeper/ws-3.1.0 greenkeeper/ws-3.2.0 greenkeeper/ws-3.3.0 greenkeeper/ws-3.3.1 greenkeeper/ws-3.3.2 greenkeeper/ws-3.3.3 greenkeeper/ws-4.0.0 greenkeeper/ws-4.1.0 greenkeeper/ws-5.0.0 greenkeeper/ws-5.1.0 greenkeeper/ws-5.1.1 greenkeeper/ws-5.2.0 greenkeeper/ws-5.2.1 greenkeeper/ws-5.2.2 greenkeeper/ws-6.0.0 master
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bot
client
docs
server
shared
test
.babelrc
.eslintignore
.eslintrc.json
.gitignore
.travis.yml
Dockerfile
LICENSE
README.md
app.js
app.json
package-lock.json
package.json

README.md

Jass Challenge Build Status

Greenkeeper badge

Deployment

Deploy

Wiki

https://github.com/webplatformz/challenge/wiki

Styleguide

https://github.com/RisingStack/node-style-guide

Build Server

https://travis-ci.org/webplatformz/challenge

What is it?

The idea of this project is to run as a server whilst bots or humans play Jass (Schieber) against each other. It has two basic modes that clients can select to play.

Single Game Mode: Just one game that will start as soon as 4 players are connected to it. When one team reaches 2500 points it will be finished and every client of this session will be disconnected.

Tournament Mode: This mode has to be started over the Web Frontend of the server. Any number of bots can join this tournament. Since Schieber Jass is always played as a team, you have to connect two instances of every bot. This is validated with the name of the bot. When every bot has two instances connected, you can start the tournament over the UI and then every bot will be matched against all other bots at least once. Depending on your setting of rounds in the tournament (see Environment Section) it can be more than once.

Installation

You only need NodeJS to run this server. If you don't want to install NodeJS on your machine see: Docker Section

NodeJS

Installing node.js:

See http://nodejs.org/download/

Install node modules:

$ npm install

Start the server:

$ npm start

Docker Container

If you want to run the server in a docker container you can find a Dockerfile in this repo.

Build it and run it with:

docker build . -t jasschallenge # '.' is the directory of the repo
docker run -it --rm --name cs -p 3000:3000 jasschallenge

Environment Variables

There are some env variables you can set to alter the behaviour of the server.

  • TOURNAMENT_ROUNDS

    A number that represents the amount of rounds a tournament will run. Each round all bots will play once against all other bots. Defaults to 1.

    The Dockerfile already contains this environment variable and sets it to 5. So if you start the server with docker, default will be 5. To change this, simply edit the Dockerfile and build the image again like shown above.

  • TOURNAMENT_LOGGING

    Boolean, if set to true, the server will store a json file for each game (Bot vs. Bot) with all the messages for parsing. These messages will be stored to the base directory of this repo.

  • TOURNAMENT_COUNTING

    Boolean, if set to true, the server will count all modes without any multiplications (e.g. factor 3 for obenabe or undenufe will not be used).

Development

While developing you might want to run the server with a watch task. You can either use:

npm run start:watch

This task will start all the other tasks in watch mode. You can also start them directly. E.g.:

npm run build:js:frontend:watch

For more information check the package.json

To get more debug output there is a 'debug' task too:

<-- Start Broadcast: 
<-- Send Message: {"type":"BROADCAST_WINNER_TEAM","data":{"name":"Team 2","points":0,"currentRoundPoints":0}}
<-- Send Message: {"type":"REQUEST_PLAYER_NAME"}
<-- Received Message: {"type":"CHOOSE_PLAYER_NAME","data":"PlayerName"}
<-- Send Message: {"type":"REQUEST_SESSION_CHOICE","data":[]}
<-- Received Message: {"type":"CHOOSE_SESSION","data":{"sessionChoice":"AUTOJOIN"}}
<-- Start Broadcast: 
<-- Send Message: {"type":"BROADCAST_SESSION_JOINED","data":{"name":"PlayerName","id":0}}
End Broadcast -->

or if you just want to start the server without watching and debug output use:

$ npm start

TechStack

  • ECMA Script 6
  • NodeJs
  • Mocha
  • Karma
  • Express
  • WebSockets
  • React
  • Flux