Skip to content

aurium/js-game-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Aurélio A. Heckert
Aug 21, 2015
8cecaec · Aug 21, 2015

History

69 Commits
Jul 23, 2014
Aug 11, 2014
Jun 15, 2015
Jun 15, 2015
Jul 29, 2014
Aug 21, 2015
Aug 11, 2014
Jul 27, 2014
Jul 23, 2014
Sep 5, 2014
Aug 1, 2014
Aug 3, 2014
Aug 21, 2015

Repository files navigation

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.