A web server for playing the Brogue over the internet. Brogue is a game for Mac OS X, Windows, and Linux by Brian Walker. For more information go https://sites.google.com/site/broguegame/. The server only can be run on a POSIX environment at the moment.
###Step 1: Get Dependencies ###
Get the latest version of node.js and mongoDB. Since node.js is still a bit unstable, I would recommend getting the package directly from their site rather than from the repositories
Navigate to the server directory and run npm install
to get the node dependencies
Because I am just dumping the data from brogue over to the node server, there are not any special dependencies for compiling brogue. So you don't need SDL, tcod, or ncurses to get it to compile. It should be as simple as make web
in the brogue directory and it will place the executable in brogue/bin.
Starting the server should be as simple as starting up mongoDB and starting the node process. You will probably need root permissions to start both of these processes:
- To start the mongodb daemon type
mongod
- To start our server type
node server/app.js
or jusnode server/
from the root directory
You will probably want to edit server/config.js to set the ports and the server secret. Note that client/dataIO/socket.js also needs to have the websocket port that you have set hardcoded.
If everything is running correctly it should say "Server listening on port 80"
To upgrade brogue, grab the latest version of the brogue source code from https://sites.google.com/site/broguegame/ for linux and update the platform code to include my changes. I have intentionally tried to keep my updates separate from the original brogue game logic as much as possible so my updates are limited to the following 4 files:
- Add platform/web-platform.c
- Update platform.h to define webConsole
- Update platform/main.c to set the currentConsole to webConsole if we are compiling with web
- Update the makefile
Future updates to brogue will likely not prevent any of these updates from being added, though care must be given if the platform-dependant logic changes for some reason.
Subsequent to this, I (flend) have made rather more extensive brogue edits. I don't anticipate it being hard to apply these to a newer brogue and I will make a diff.
Server global configuration variables are defined in server/config.js. You may need to adjust these depending on how your environment is set up.