ArkahnX / js-game-server

Sandboxed JavaScript Game Server

Home Page:http://js13kGames.github.io/js-game-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The game server for the js13kGames Competition.

Build Status dependency status dev dependency status

Deploy

$ git clone git://github.com/js13kGames/js-game-server.git
$ cd js-game-server
$ npm install
$ npm test

Running

$ cd /path/to/js-game-server
$ npm start

Configuring

You can place the configuration in one of this places:

  • user local config dir: $HOME/.config/js-game-server/config.json
  • system config dir: /etc/js-game-server/config.json
  • in the application root: <js-game-server-dir>/config.json

This list is ordered in precedence order.

The config.json is a JSON file with this structure:

{
  "games_directory": /* where the server can find game dirs to load? */,
  "sanctioned_modules": [ /* external allowed modules for sandbox require */ ],
  "log": { /* this section is optional */
    "withColors": /* (boolean) colors on console output */,
    "silentSTDIO": /* (boolean) stop console log */,
    "toFile": /* (string) a file path, or "STDIO" */
  },
  "domain": /* (string) defaults to localhost */
  "lobbyPort": /* (integer) the main httpd, that list games. */,
  "gamePortStart": /* (integer) Game ports are sequential. */
}

Colorful logs are useful for devs, but not for grep in production history.

Playing

If you don't change the defaults, visit http://localhost:3000 and you will see the game lobby, listing the example games. Click on any game and you will get it in another port with it's own http server.

Contributing

Register an issue, clone, code, push and request a merge.

About

Sandboxed JavaScript Game Server

http://js13kGames.github.io/js-game-server

License:GNU Affero General Public License v3.0


Languages

Language:JavaScript 90.5%Language:CSS 9.5%