Git Product home page Git Product logo

block-game-activity's Introduction

block-game-activity

a classic version of a popular block game as a discord activity screenshot

note: this is mainly a proof of concept. the code SUCKS (a lot of it was taken from discord's tutorial), and it's weird to host.

what you'll need to host this

  • a server, either a raspberry pi or something in your house or a VPS, and on it:
    • a web server with reverse proxy (configured for proxying websockets too!!!) and HTTPS configured, as discord doesn't allow you to host activities over HTTP (personally i use nginx)
      • refer to the sample nginx config in this repo for details on how to actually configure it
    • a minecraft classic/classicube server that supports websockets (or in other words - classicube's web client) and either doesn't verify username or allows you to disable it (MCGalaxy meets this criteria)
    • node.js (at least v18)
    • something to allow shit to run in background
  • a domain name (stuff like noip probably can be used for this)
  • a discord app with activities enabled (create one here)

setup

  1. clone this repo to your server
  2. rename example.env to .env
  3. edit .env file with your discord app client id and secret
  4. run npm i in both client and server folders
  5. configure your web server as required if you haven't already (as written above, sample nginx config is in the repo)
  6. make sure your minecraft classic server is up and running (and that it doesn't verify usernames)
  7. run npm run dev in both client and server folders (do so in screen screens, tmux sessions or whatever you prefer)
  8. go to your discord app settings -> activities -> url mappings and put your domain name in the root mapping
  9. also go to settings -> oauth2 and put your domain name in redirects section url mappings section oauth2 section
  10. enable developer mode in your discord client
  11. go on a voice channel on a server that has 25 members max (discord limitation, as custom activities are in "Public Developer Preview") and try to run your activity
  12. profit???

playing with friends

i'm guessing this is a "Public Developer Preview" limitation too, but, to play with friends, you'll need to add them as your application tester.

when you do so, they still won't be able to actually start the activity, but they will be able to join it when you host it.

to invite your friends, go to your discord app settings -> app testers and put in their usernames (not screen names!!!!). they will receive an email with a link to accept the invite. after this, they will be able to join the activity hosted by you.

if you REALLY want your friends to be able to start the activity, you might need to move your app to a group and add your friends here. beware, as by doing so you technically allow them to mess with the app settings! only do this with people you ABSOLUTELY trust, or you can punch in their face if they screw something up.

block-game-activity's People

Contributors

szprinktrap avatar

Stargazers

 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.