Giter Club home page Giter Club logo

web-brogue's Introduction

Web Brogue

A web[sockets] 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.

Build Instructions

Step 1: Get Dependencies

Get the latest stable version of node.js and mongoDB. (Or whatever mongoDB comes with your distro which should be fine.)

Step 2: Get node packages

Navigate to the server directory and run npm install to get the node dependencies. You'll need a C++ compiler to compile the datagrams module.

Step 3: Build Brogue Executables

The paths to the binaries is stored in server/config.js. Brogue binaries are stored in the binaries/ directory. Linux ELF binaries are included in the distribution for all supported brogue versions. If there's a new version of a brogue variant, or a replay-breaking change is added to a brogue version without changing the version, create a new variant and add a new brogue binary. This allows old recordings to still work. (Note that a new variant means separate high scores for now.)

The lineage of each brogue version and build instructions is given below. You shouldn't need to follow these unless you're building for a different platform.

  • Brogue (1.7.4): cd brogue make web
  • Brogue (1.7.5): cd brogue-1.7.5 make web
  • gBrogue: cd gbrogue make -f Makefile.linux web
  • unBrogue: cd unBrogue make web
  • broguePlus: cd brogueplus make web
  • Brogue CE (1.8): Clone https://github.com/flend/BrogueCE and checkout branch tracking/web-brogue. make bin/brogue then copy binary to binaries/brogue-ce18
  • Brogue CE (1.9): Clone https://github.com/flend/BrogueCE and checkout branch tracking/web-brogue-v193. make bin/brogue then copy binary to binaries/brogue-ce19-c813284 (or similar filename)
  • Brogue CE (1.10): Clone https://github.com/flend/BrogueCE and checkout branch tracking/web-brogue-v110. make bin/brogue then copy binary to binaries/brogue-ce110 (or similar filename)
  • Brogue CE (1.11+): Clone https://github.com/flend/BrogueCE and checkout branch tracking/web-brogue-v1XX. make bin/brogue then copy binary to binaries/brogue-ce111 (or similar filename). This binary also includes RapidBrogue from v1.5+
  • Rapid Brogue (v1.4 and earlier): Clone https://github.com/flend/rapidbrogue and checkout branch tracking/rapid-brogue-vXXX. make bin/brogue then copy binary to binaries/rapid-brogue-vXXX (or similar filename)

Starting the Server

Starting the server should be as simple as starting up mongoDB and starting the node process.

  1. To start the mongodb daemon type mongod (this should be started at system init in most cases)
  2. To start the server type npm start in the server directory.

You will probably want to edit server/config.js and client/config.js to set the ports and the server secret.

If everything is running correctly it should say "Server listening on port XXXX"

Note that you might need root access if you are running on a privileged port (e.g. 80).

Configuration

Server global configuration variables are defined in server/config.js. Client configuration variables are defined in client/config.js.

In particular, make sure to get the client and server to agree on the websocketPort.

Restarting the server

When you restart (kill and run again) the server to start running a new version, games in progress are not affected. However, the server will forget about its registry of games that it uses to kill inactive games from over 2 weeks ago. Therefore you probably want to kill old games. A good command is killall --older-than 1M -r ".*brogue.*" which kills all brogue process started more than 1 month ago.

Tests

An API test suite can be run using npm test in the server directory.

web-brogue's People

Contributors

bleakley avatar flend avatar jtraub avatar kipraske avatar kipwustl avatar notnmeyer avatar thomasaford avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

web-brogue's Issues

Keyboard layout issue

Using Colemak, whenever i release the Shift key, graphics get toggled between tiles and glyphs. This is annoying for traveling in straight lines or to stairs - interestingly, if I keep holding shift down, I can issue several commands that way, only being annoyed by the toggle when i let go. (Am starting to get in the habit of just giving it an extra tap, which is okay.)

Other forks?

I noticed that at roguelikelike.com (which is hosted by you, @flend ?) unBrogue and gBrogue are available for play. Cool!

Here's some other possibilities, all are based on 1.7.4 i think:

BrogueRoles - lets you pick a sort of "character class" before you enter the dungeon. For instance, if you choose Barbarian, no staves will appear in your game, instead other items will. https://github.com/tsadok/brogue/compare/roles https://libredd.it/r/brogueforum/comments/5azesv/brogue_roles_a_way_to_choose_an_overall_build/ I'd probably be willing to rebase this onto 1.9.3 if you like.

Sulai's Brogue - I'm not sure what to call this fork, but it has many interesting features that aren't merged into its main branch, instead each feature is on a separate branch. On this branch, the death of an empowered ally results in your empowerment wand(s) being recharged. https://github.com/sulai/Brogue/tree/feature/recharge_empowerment_on_ally_dead If you like, I'd be willing to combine any branches that look interesting, into one grand fork. It looks a little too complex to rebase onto 1.9.3

Broguer - there's not a lot here except some convenience / QoL stuff. https://github.com/yrmvgh/BrogueR

game reset on logging in

Hi, I think the issue here may be due to lag, but I had a saved game on gBrogue on the EU server (I'm in the US). I was in the lobby and clicked to observe another game. The page didn't respond. I then clicked "continue game" next to my save game and it started a new game, apparently destroying my old save file.

Add test for happy path websockets

There is no test for the websockets API to check the happy path of playing brogue works. This should be added to the existing test suite.

unbrogue detonation/spear/blinking weird interaction

It seems as though when a monster with a detonation effect blinks into the square covered by the player's spear, and the resulting "you hit the imp as it moves toward you" attack kills the blinking monster, then the monster's corpse will explode at the square it blinked from, not the square it blinked to.

This isn't the worst thing because it would've been a super frustrating probable death if it had blown up next to me, but it looks funny.

Remove "Show dungeon seed", reset leaderboard

Currently WebBrogue has the "view dungeon seed" command available.

This means that anyone can use it, run a local copy of Brogue with that seed, and obtain information on the whole dungeon of the online game, thus gaining a massive and unfair advantage over players who are not using such a method (and of course, this is not a fun way to play).

Hence, Brogue should be patched to remove that command, which is not suitable for online play.

The leaderboard also needs to be reset, since there is no way to tell whether the high scores currently in it are legitimate due to the existence of this exploit.

In addition, since dungeon seeds are only 32-bit, it may be possible to brute force the seed even without the command, and if the RNG algorithm is weak it may also be possible to just compute the seed based on the observed output of the RNG determined from dungeon layout.

Thus, it would be a good idea to also fix Brogue so that it uses a secure RNG (e.g. Isaac, a ChaCha20-based RNG or an AES-based RNG) seeded from 256 bits from /dev/urandom instead of what it currently used.

SSH support?

I'm not sure if this is too much to ask, but can you add support to connecting to a web brogue server through (preferably) a 256-color terminal, or even a standard 16-color terminal when necessary?

No way to abort game after crash

If a brogue game crashes, there is no way to abort the game. Clicking on "Start or continue game" automatically dumps you back to the lobby.

in UnBrogue, rune presses burn staffs up

I've noticed in a few games that rune presses burn staffs up instead of applying the rune to them.

Looking at the UnBrogue code I suspect that the issue is here, web-brogue/unBrogue/UnBrogueCode/Items.c lines 9431-9441

if ((theFirstItem->category & KEY) && (theFirstItem->kind == KEY_RUNE_WAND) && (theSecondItem->category & (WAND))) {
applyRunetoWandorStaff(theFirstItem, theSecondItem);
}
else if ((theFirstItem->category & KEY) && (theFirstItem->kind == KEY_RUNE_WAND) && (theSecondItem->category & (WAND))) {
applyRunetoWandorStaff(theFirstItem, theSecondItem);
}
else if ((theSecondItem->category & KEY) && (theSecondItem->kind == KEY_RUNE_STAFF) && (theFirstItem->category & (STAFF))) {
applyRunetoWandorStaff(theSecondItem, theFirstItem);
}
else if ((theSecondItem->category & KEY) && (theSecondItem->kind == KEY_RUNE_STAFF) && (theFirstItem->category & (STAFF))) {
applyRunetoWandorStaff(theSecondItem, theFirstItem);

I don't know C, but it looks like the first two conditions are identical, and the last two conditions are identical. I think in the second condition (theSecondItem->category & (WAND) should be (theSecondItem->category & (STAFF) and in the third condition (theSecondItem->category & (STAFF) should be (theSecondItem->category & (WAND) [or something similar], so it will call properly with a staff and a rune in either order, or a wand and a rune in either order.

As things are, I bet that something calls this code with theFirstItem as the rune and theSecondItem as the staff, the code passes through here, and then bad things are happening somehow.

Unable to disable some variants

Hello,

I did try to remove some variant (UnBrogue, Brogue 1.7.4) but it's still showing up on the front-end.

What is the proper way to disable specific variant? Thanks

Allow to play regardless of current keyboard layout

At the moment web-brogue allows to play only if your current keyboard layout is set to English.

I think it would be great to update web-brogue to make it layout-insensitive. Having this feature is especially important for the web version since layout switch applies to entire browser window.

Refactor high scores API

The addition of ?username= to the /api/games endpoint should deprecate the old /api/games/:user endpoint and the user filtering also applied to /dailygames etc. The client model should be updated and simplified

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.