Giter VIP home page Giter VIP logo

d6-together's Introduction

d6 Together

A web app for playing Forged in the Dark games online. d6 Together uses ws for networking, Rapier 3D for physics, and three.js for 3D rendering.

Running the Server

You can build and run your own server from the source code; all you strictly need is NodeJS (v18.20 or later). You can get the source code from GitHub.

Once you have the code, execute the following commands within the project root to start the server.

# Get dependencies (only needed the first time)
npm install

# Build the application from source (only needed the first time and after changes to the source)
npm run build

# Run server
npm run server

By default, d6 Together uses port 6462. This can be easily changed at the top of d6-together.js (changing the port does NOT require re-building the app). Use your browser to connect to the server (e.g. localhost:6462), and you're all set!

When deploying to a production environment, you'll need the dist/ directory (which is created with npm run build), d6-together.js, and the package.json and package-lock.json files. Running npm install --omit=dev will install the necessary dependencies, and npm run server will run the server. For convenience, those two commands are combined in npm run deploy.

Local Files with Remote Server

If you want to host the files locally but connect to a remote d6 Together WebSocket server, you can easily change the target server using window.d6t.WS_ADDRESS. Either edit multiplayer.js to change the default assignment or open up your web browser's console on d6 Together and reassign window.d6t.WS_ADDRESS before hosting or joining. However, this will not work without some server-side configuration.

By default, d6 Together WS servers will reject connections where the host (the WS server) and origin (the HTTP server) do not match. This can be changed by editing d6-together.js, specifically the variable REJECT_HOST_ORIGIN_DIFF. Similarly, you can arbitrarily restrict origins by editing the allowOrigin(origin) function.

d6-together's People

Contributors

itsalxl avatar dependabot[bot] avatar

Watchers

 avatar

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.