Git Product home page Git Product logo

2based2wait's Introduction

2Based2Wait

Lightweight & extensible 2b2t proxy.

Wiki · Report a Bug · Configuration Guide · Discussions

Last Commit Code Size Current Version License

Table of Contents

Installation

Prerequisites

Quick Start

  1. Clone the latest release: git clone https://github.com/Enchoseon/2based2wait --branch v1.0.5 --depth 1 && cd 2based2wait
  2. Install dependencies: pnpm install --prod
  3. Configure your proxy:
  4. Start the proxy: pnpm start

RTFM

We'll never phone home or enable something you didn't. In other words, you are responsible for enabling and configuring features such as:

Read the Fun Manual

"Read it and you'll understand everything", RMS

Features

  • Extremely low RAM and CPU usage
  • Robust auto-reconnection
    • Battle-tested to be online 24/7/365
  • High configurability
    • Easily configure small-to-medium-sized networks
  • Convenient Discord webhooks for:
    • Livechat
    • Queue position
    • Tunnels & connections
  • Toast notifications
  • Auto /queue main
  • Mineflayer support and extensibility (see: ./utils/mineflayer.js)
    • Already comes with:
      • Kill aura
      • Auto eat
      • Anti afk
      • Anti drowning
      • Auto totem
  • Extensive logging
  • Share proxies with plug-and-play Ngrok tunnels
    • Your machine's IP is never shared with players connecting to your proxy
    • Your players' IPs are never shared with your machine

Images

Cli Gui

No-Frills Cli Gui

Webhooks

Convenient Discord Webhooks

Grep

Extensive Logs

For Developers

If you want to contribute to the project's source you must install developer dependencies (pnpm i) and use an editor with ESLint support.

You can run tests locally with pnpm testLocal. (pnpm test will test your actual config.json rather than ./test/test-config.json)

2based2wait's People

Contributors

dekrom avatar dependabot[bot] avatar enchoseon avatar okbenito avatar unclamped avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

2based2wait's Issues

Cannot find module 'prismarine-chat'

Error: Cannot find module 'prismarine-chat'
Require stack:

  • C:\Users[redacted]\Desktop\proxies\2based2wait\util\chatty.js
  • C:\Users[redacted]\Desktop\proxies\2based2wait\proxy.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
    at Function.Module._load (node:internal/modules/cjs/loader:833:27)
    at Module.require (node:internal/modules/cjs/loader:1057:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object. (C:\Users[redacted]\Desktop\proxies\2based2wait\util\chatty.js:11:21)
    at Module._compile (node:internal/modules/cjs/loader:1155:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
    at Module.load (node:internal/modules/cjs/loader:1033:32)
    at Function.Module._load (node:internal/modules/cjs/loader:868:12)
    at Module.require (node:internal/modules/cjs/loader:1057:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\[redacted]\Desktop\proxies\2based2wait\util\chatty.js',
    'C:\Users\[redacted]\Desktop\proxies\2based2wait\proxy.js'

read ECONNRESET error

while joining the proxy server, mc loading screen stops working and only shows "loading world", ive checked my error logs and this is the code showed afer this happening:

Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:217:20) { errno: -104, code: 'ECONNRESET', syscall: 'read' }

ive tried this on 2 diferent machines, a server running ubuntu and my own machine running Arch and in both got similar results (even running diferent nodejs versions)

adding to that, if you try and press Escape kiey while loading screen is frozen, the proxy will start restarting, and then crash.

take in mind that my configuration is the one recomended in the wiki for prio accounts as my test account has priority queue

Leaving without sending disconnect package bugs proxy

When you leave the proxy without sending the proper disconnect packet It freezes in the state of thinking that player is on the proxy even if is not using it anymore, the detection fails to check if the player is still online.

.

.

Cant connect to proxy

I cannot connect to a proxy.

With default config 127.0.0.1:25565 refuses to join, if i change loopback adress or port, i still cant

.

.

TypeError: registry.supportFeature is not a function

After Adjusting the "localHost" Specification for the server address to 0.0.0.0 to fix an issue where i was unable to connect i still can't get the program to work.

2B2W Will connect to the target server, anti afk works, but once i connect the program bombs out at states

C:\Users\REDACTED\2based2wait\node_modules\prismarine-item\index.js:51
if (registry.supportFeature('itemSerializationAllowsPresent')) {
^

TypeError: registry.supportFeature is not a function

Cant connect through localhost

When i tried to connect to the localhost it gave an error internal exception: io.netty.handler.codec.decoderexception: com.google.gson.jsonsyntaxexception: expected text to be a string, was an object ({"f...t"}) when i looked at the console it says

Disconnecting client because error TypeError: Serialization error for play.toClient : Write error for undefined : Cannot read properties of undefined (reading 'length')
    at module.exports.Write.UUID (C:\Users\Lenovo\2based2wait-1.0.5\node_modules\.pnpm\[email protected]\node_modules\minecraft-protocol\src\datatypes\compiler-minecraft.js:48:25)
    at eval (eval at compile (C:\Users\Lenovo\2based2wait-1.0.5\node_modules\.pnpm\[email protected]\node_modules\protodef\src\compiler.js:258:12), <anonymous>:1909:30)

Crafting

I have an issue with crafting on the proxy. If i start crafting my game crushes but proxy stay on the server.

1.19.4

1.19.4 Release: Biting the Bullet

Original message text kept below for posterity


Introduction

With 8 months of changes including a total refactor pending a stable release, 2b2t's sudden update to 1.19.4 would've normally thrown a wrench into stabilization plans, but the unexpected death-blow ended up being thrown by 2b2t's owners, driving away many long-time basehunters and creative juggernauts.

I'm making this GitHub issue a bit late, I know, but I had bigger issues to deal with as my friends and I reevaluated whether we wanted to spend hundreds of more hours and dollars on 2b2t (not just cumulatively for some). Personally, I won't be.

This doesn't mean the project is dead, though. Keep reading to learn more.

Technical Problems

1. Mcproxy

2based2wait currently lacks proxy functionality on 1.19.4 because mcproxy, a core library that replicates Minecraft networking with high-level APIs in Node.js, needs to be updated from 1.12.2 to 1.19.4.

This isn't a simple TCP tunnel being switched on and off, this is a replication of Minecraft's networking protocol that allows for deep integration with high-level APIs with minimal boilerplate. It's why complex logging behaviors and Mineflayer actions can be rapidly implemented with fewer LOC and lower development cost.

IceTank is currently working on updating Mcproxy to support 1.19. IceTank has a fantastic reputation and AFAIK still mains 2b2t. One the one hand, this is the beauty of open-source, on the other, this is a major point of failure that I don't have the time or skills to fix myself. Major thanks to IceTank and other contributors.

2. Non-Vanilla Behavior & Pay-to-Test

There is a myriad of problems caused by 2b's heavily-modded behavior—which is opaque, always-shifting, and requires constant attention and time and money.

And I don't just mean money in the asinine sense that "time is money" or "development is money", because even long-term run-of-the-mill maintenance requires one to run tests at an interval that isn't 6+ hours between each test.

And of course, as a maintainer and hoster, my maintenance duties go far beyond run-of-the-mill tests because I'd be notified of odd issues and glitches that I could't replicate anywhere other than 2b2t. It was incredibly frustrating and an exercise in futility. This impossible game of cat and mouse is the primary reason the next stable release of 2based2wait was in development hell for 8 months.

As a hoster (see: Eating your own dog food), high uptime and stability came first and foremost, leading to a mentality of "don't touch it or you might break it", which was oftentimes the case thanks to 2b's opaque and non-vanilla behavior.

With the update to 1.19.4, 2b2t's admins have implemented an even wider array of blatantly non-vanilla behavior that requires endless workarounds and debugging. At least Sisyphus's rock didn't get heavier every month and also have a paywall.

I haven't made a single penny from this project, redirecting prospective donors to the EFF and FSF with unknown success rates. Now that I no longer main 2b2t and have less free time, I really don't see myself doing the sort of extensive testing I used to do 2 years ago.

3. Dependency Hell

A lot of these problems only rear their head once you try to make software that actually remains functional for as long as possible with high uptime.

"Then why didn't you just write it in Rust/C99?!". That would alleviate most of the Node.js dependency hell and rot, but kinda the whole point of 2based2wait is tight integration with high-level Prismarine JS APIs that make 2based2wait a fun tool for hackers to tinker with.

It's difficult to balance fun programming with good engineering because good engineering isn't fun, and Node.js has some of the worst dependency hell known to mankind, second only to Python.

Anyone who says "A good engineer never blames their tools" has never tried to maintain anything larger than 2k LOC in Python or Node.js. Motherfuckers need package management.

Conclusion, The Future

I'm not cutting off support for 2b2t entirely, as it is relatively easy to occasionally fix trivial things like queue header parsing or brand packet changes or whatnot.

BUT I have zero interest in adding special loopholes and bugfixes for 2b2t. If 2b2t's anti-dupe or anti-xray breaks a bunch of shit, oh well. I ain't buying prio queue to fix bugs on a server I no longer play on.

However, 2based2wait will still be useful on other anarchy servers on 1.19.4 for things like sharing accounts with a bunch of people without invalidating the token or clamoring over each other trying to figure out what account is currently in use—not to mention fun things I've yet to add like the automatic Minecraft Replay Mod recorder.

In short, 2based2wait isn't dead, yet, but the onus will be on the users to file bug reports that aren't shit because I will no longer be eating my own dog food, at least on 2b2t, and I offer zero guarantee for 2b2t-specific support given the admin's recent changes.

account

accidently signed into the wrong microsoft account now it keep saying Error: Failed to obtain profile data for Vluurz, does the account own minecraft?
at Object.authenticate (C:\Users\user\2based2wait\node_modules.pnpm\[email protected]\node_modules\minecraft-protocol\src\client\microsoftAuth.js:31:40)

Cannot connect to tunneled proxy: Cannot connect to server

Hey, I'm trying to run 2b2w with my free ngrok.io token, and I can see an URL being displayed in the console output and Discord spam webhook, but when I try to connect to it, it just doesn't look as if a server actually existed, giving the error "Cannot connect to server". Judging by the output, there are no visible errors, and the proxy is connected to 2b2t, so that's odd.
On a side note, would it be possible to create a Discord or Matrix or anything server for easier and faster troubleshooting and discussion? Thanks :)

Enable discussions for easier communication

Enabling GitHub Discussions on this repo could allow for a more well-suited place for communication,

making it easy to communicate with your community, ask and answer questions, share updates, and more.
- What is GitHub Discussions? A complete guide

I feel like this repo could take advantage of these features. Instead of needing something like a Discord server or direct communications with the devs through other platforms, we could have all of these conversations in the same place and available to the public to avoid redundancy in the future.

[1.19.4] Stats lost on client reconnect

if you are not connected at the time proxy logs in or you decide to reconnect, the following stats are broken:

  • Food restoration speed (for some reason food fills up as with saturation effect on, each time you lose a hunger point it resets then quickly goes to full again) [workaround: die / switch dimension]
  • Advancements menu is empty
  • Recipe book is empty
  • Exp is set to 0 until you lose/get some
  • If you were in a boat it could just be not sent to you so you can't break it and 2b2t invalidates your every movement so the only solution would be to call someone to go help you, join without a proxy (duh) or die somehow

might miss out on some but i think this is as far at goes for now

Cannot close Git without needing to reinstall

When I close Git, proxy.js does not run in the background. If i reopen in and run pnpm start, it displays an error message .If that is intended, is it possible that I can make it run in the background somehow?

Proxies getting stuck and kicked for afk

I am letting some of my proxies walk around spawn but they are getting kicked for afk if they get stuck in a 1x2 bedrock hole or in a lava cast. Would it be possible to make the bots constantly jump so they die of hunger before they can get afk kicked? Thank you!

SyntaxError: Unexpected token o in JSON at position 1

Ubuntu server
Ubuntu 22.04.3 LTS x86_63

Last Update: [4-10-2024 3:32:36 AM]
Account: ###########
Current Controller: None
Current Queue Position: CHECKING...
ETA: CHECKING...
Restart: None
In Queue Server: TRUE
Mineflayer Running: TRUE


/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/minecraft-protocol/src/transforms/framing.js:67
         } else { throw e }
                  ^

SyntaxError: Unexpected token o in JSON at position 1
   at JSON.parse (<anonymous>)
   at Object.playerlistHeaderPacketHandler (/home/reece/2based2wait/util/queue.js:57:22)
   at packetHandler (/home/reece/2based2wait/proxy.js:55:8)
   at Client.<anonymous> (/home/reece/2based2wait/proxy.js:158:3)
   at Client.emit (node:events:513:28)
   at emitPacket (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/minecraft-protocol/src/client.js:82:12)
   at FullPacketParser.<anonymous> (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/minecraft-protocol/src/client.js:112:9)
   at FullPacketParser.emit (node:events:513:28)
   at addChunk (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_readable.js:279:12)
   at readableAddChunk (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_readable.js:262:11)
   at Readable.push (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_readable.js:228:10)
   at Transform.push (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_transform.js:132:32)
   at FullPacketParser._transform (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/protodef/src/serializer.js:89:10)
   at Transform._read (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_transform.js:166:10)
   at Transform._write (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_transform.js:155:83)
   at doWrite (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_writable.js:390:139)
   at writeOrBuffer (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_writable.js:381:5)
   at Writable.write (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/_stream_writable.js:302:11)
   at Decompressor.ondata (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/internal/streams/readable.js:705:22)
   at Decompressor.emit (node:events:513:28)
   at addChunk (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/internal/streams/readable.js:321:12)
   at readableAddChunk (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/internal/streams/readable.js:298:9)
   at Readable.push (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/internal/streams/readable.js:244:10)
   at Decompressor._transform (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/minecraft-protocol/src/transforms/compression.js:52:12)
   at Transform._write (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/internal/streams/transform.js:153:8)
   at writeOrBuffer (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/internal/streams/writable.js:334:12)
   at _write (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/internal/streams/writable.js:283:10)
   at Writable.write (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/internal/streams/writable.js:286:10)
   at Splitter.ondata (/home/reece/2based2wait/node_modules/.pnpm/[email protected]/node_modules/readable-stream/lib/internal/streams/readable.js:705:22)
   at Splitter.emit (node:events:513:28)

Node.js v18.10.0
 ELIFECYCLE  Command failed with exit code 1.
reece@ubuntusrv:~/2based2wait$ 

Reconnect does not do its job

The wiki says, when the proxy wants to reconnect, it exits happy.
The thing I get however is the following:

Current Queue Position: 88
ETA: 1h50m
Restart: Reconnecting now!
In Queue Server: TRUE
Mineflayer Running: TRUE

 ELIFECYCLE  Command failed with exit code 1.

From my understanding, 1 is sad, not happy. 0 is happy.

The output also gives no justification for why it has chosen this code. It even says it wants to reconnect.

Unless i'm horribly mistaken and 1 means success in javascript, in which case sorry for getting my small linux brain in your way (and i will never learn that language then).

Feature: Chat Bridge

Haven't had the time to maintain this project like I used to, so kinda just going to work on what I personally need (lol). RIP in peace all the Windows users who have been making incredibly unhelpful issues that I don't have the time to be tech support for.

A big feature I'd like is a chat bridge so that I can chat from console instead of having to open Minecraft whenever I'm out and about.

will this project be maintained?

As the title suggests, will this project be maintained? Seems like a better alternative to 2bored2wait and would like to see more updates in the future. Also, I am curious to know if there's a discord server, telegram group or matrix server for updates and support for your project. Would love to see more from this project <3

Reading Books crashes the client

I've been using the project for some time and when I try to read any book (Doesn't matter how long is it) as soon as I do the secondary click to get the book data my proxy freezes and gets kicked out the server.

Error

TypeError: registry.supportFeature is not a function
at toNotch (/home/ubuntu/Downloads/2based2wait/node_modules/.pnpm/[email protected]/node_modules/prismarine-item/index.js:51:20)
at /home/ubuntu/Downloads/2based2wait/node_modules/.pnpm/@rob9315[email protected]/node_modules/@rob9315/mcproxy/lib/packets.js:93:58
at Array.map ()
at generatePackets (/home/ubuntu/Downloads/2based2wait/node_modules/.pnpm/@rob9315[email protected]/node_modules/@rob9315/mcproxy/lib/packets.js:93:44)
at Conn.generatePackets (/home/ubuntu/Downloads/2based2wait/node_modules/.pnpm/@rob9315[email protected]/node_modules/@rob9315/mcproxy/lib/conn.js:71:47)
at Conn.sendPackets (/home/ubuntu/Downloads/2based2wait/node_modules/.pnpm/@rob9315[email protected]/node_modules/@rob9315/mcproxy/lib/conn.js:67:14)
at createBridge (/home/ubuntu/Downloads/2based2wait/proxy.js:306:9)
at Server. (/home/ubuntu/Downloads/2based2wait/proxy.js:236:4)
at Server.emit (node:events:513:28)
at loginClient (/home/ubuntu/Downloads/2based2wait/node_modules/.pnpm/[email protected]/node_modules/minecraft-protocol/src/server/login.js:128:12)

Node.js v18.15.0

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.