Giter Site home page Giter Site logo

san4ost / 2bored2wait Goto Github PK

View Code? Open in Web Editor NEW

This project forked from themoonisacheese/2bored2wait

0.0 0.0 0.0 242 KB

A proxy to wait out 2b2t.org's way too long queue. Includes a small webserver and a REST-like API for external control

License: GNU General Public License v3.0

CSS 2.49% HTML 14.61% JavaScript 77.42% Dockerfile 1.45% Shell 4.02%

2bored2wait's Introduction

2bored2wait

A proxy to wait out 2b2t.org's way too long queue.

Donate

How to install

  1. Download and install node.js version 14 or above and git. You need git even if you download the repository as zip because it is to install the dependencies via npm. On non-windows platforms, you also need npm.
  2. Download this repository with the green button (top right of this page). If you downloaded it as zip, unzip it.
  3. Open a terminal and navigate to the folder you downloaded it in.
  4. Run npm install
  5. Copy config/config.json.example and name it config.json. Replace DISCORDBOT_FLAG and WEBSERVER_FLAG with true or false to your liking, then replace MINECRAFT_PROXY_PORT and WEB_UI_PORT with valid ports. Edit other values to your preference.
  6. For trust reasons, this tool does not update automatically. Check back here once in a while to see if there are any updates.

How to use

  1. Read the code to ensure I'm not stealing your credentials. I'm not, but you shouldn't take my word for it. If you don't know how to read it, downloading stuff off the internet and giving it your password is probably a bad idea anyway.
  2. Run npm start
  3. It will now ask for your Minecraft email and password (or permission to use saved launcher data instead). If you are using the discord bot you need to add your token. Then answer Y or N if you want to save your Minecraft credentials. If you answer N you will need to re-enter your Minecraft login information into the console each time you start the program.
  4. Now open a browser and navigate to http://localhost: your port here.
  5. Press the "Start queuing" button. The queue position indicator auto-updates, but sometimes it takes a while to start counting (like 1 min).
  6. Once the queue reaches a low number, connect to the Minecraft server at address localhost.
  7. After you log off, click the "stop queuing" button. This is really important, as you will not actually disconnect from 2b2t until you do that.

Commands

All commands can be used through discord or the cli.

  • start will start the queue. It takes between 15-30 seconds for the bot to update with the queue position.
  • start 14:00 will start at 2pm.
  • play 8:00 will try to calculate the right time to join so you can play at 8:00
  • update will send an update to the current channel with your position and ETA.
  • stop will stop the queue.

Video guide

Here's a video guide on how to install and use 2b2w: https://www.youtube.com/watch?v=oWeCmZNYAW4

Docker usage guide (if you know how to use docker)

  1. Read the code to ensure I'm not stealing your credentials. I'm not, but you shouldn't take my word for it. If you don't know how to read it, downloading stuff off the internet and giving it your password is probably a bad idea anyway.
  2. Edit docker-compose.yml and start the container
docker-compose up -d
  1. Open a browser and navigate to http://localhost, attach to the container, or open a chat dialog with the discord bot
  2. Press the "Start queuing" button/message the bot or cli "start"
  3. Once the queue reaches a low number, connect to the Minecraft server at address localhost.
  4. After you log off, stop the 2bored2wait queue or your account will stay logged in on the server. You can reconnect to localhost in case you disconnected by accident.

Additional configuration

If you want to change the configuration you will have to mount config.json manually, you can also mount secrets.json manually if you don't want your credentials in the bash history

To access logs you can just do

docker logs 2bored2wait

You can also easily change which port to map from the docker-compose, for example, if you want your server reachable on port 25000 instead of the default 25565 and your webserver on port 8080 you can change these varibles in the docker-compose

      ports:
         - "8080:8080"
         - "25000:25566"

Docker build guide

  1. Read the code to ensure I'm not stealing your credentials. I'm not, but you shouldn't take my word for it. If you don't know how to read it, downloading stuff off the internet and giving it your password is probably a bad idea anyway.
  2. Clone the repo
  3. run scripts/gen_dockerignore.sh to generate the .dockerignore
  4. docker build -t 2bored2wait . to build the image.
  5. Once the image has built, you can start it with:
docker run --name 2bored2wait -d -p 80:8080 -p 25565:25566 -e MOJANG_USERNAME="[email protected]" -e MOJANG_PASSWORD="myverysecretpassword" -e BOT_TOKEN="mydiscordbottoken" -e DISCORD_BOT="true" -e WEBSERVER="true" -e MINECRAFT_PORT=25566 -e WEBUI_PORT=8080 2bored2wait

** Remember to change [email protected] and myverysecretpassword with your actual Minecraft credentials, as well as mydiscordbottoken with your actual Discord Bot Token **

  1. Open a browser and navigate to http://localhost
  2. Press the "Start queuing" button. The queue position indicator auto-updates, but sometimes it takes a while to start counting (like 1 min).
  3. Once the queue reaches a low number, connect to the Minecraft server at address localhost.
  4. After you log off, click the "stop queuing" button. This is really important, as you will not actually disconnect from 2b2t until you do that.

If you want to change the configuration you will have to mount config.json manually, you can also mount secrets.json manually if you don't want your credentials in the bash history.

All additional configurations from the Docker usage guide apply here as well.

Tests

  • Run NPM test to run test.js

ETA

2b2w does not show ETA from 2b2t. The ETA is calculated based on position in the queue. This results in better ETA most of the time.

Known issues

  • Starting the queue will revoke your Minecraft token. this means that you will not be able to join normal Minecraft servers until you restart the game
  • If you connect after the queue is finished or reconnect the proxy will send cached chunk data. Otherwise you would fly in an empty world. Other data such as entities and your player inventory are not cached and will not be displayed correctly. You can move out of render distance (I find going through a nether portal works best) and return to fix this issue. Sometimes the client renders a cached chunk with a blank texture.

2bored2wait's People

Contributors

mrgeorgen avatar themoonisacheese avatar rekonnected avatar dsetareh avatar gislinielsen avatar edofullin avatar wylie39 avatar averagecomet250 avatar polyfish0 avatar zillyhuhn avatar moondarker avatar martinvingerhoets avatar elisaado avatar francescozucca avatar xhendrikg avatar whodiduexpect avatar filipton avatar hazzal avatar furriousfox avatar zax2002 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.