Coder Social home page Coder Social logo

themoonisacheese / 2bored2wait Goto Github PK

View Code? Open in Web Editor NEW
428.0 22.0 106.0 533 KB

(archived) 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 1.88% HTML 11.90% JavaScript 85.37% Dockerfile 0.69% Shell 0.16%
minecraft proxy 2b2t

2bored2wait's Introduction

contributors stars issues forks donate discord


Logo

2bored2wait

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

2Bored2Wait is not updated to 1.19. There are no plans to update. This repository is kept for posterity, but there will not be any future update here.

Other people are free to fork this repo and distribute updated copies according to the licence (GPL-3.0).

Table of Contents

  1. About The Project
  2. Getting Started
  3. How to use
  4. Configuration
  5. Roadmap and known issues
  6. Addons
  7. Contributing
  8. License
  9. Testing

About The Project

A proxy to wait out 2b2t.org's way too long queue.
Please Note that because of security reasons this tool doesn't auto-update without a plug-in (check out the addons section)! Also 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.

Built With

  • node.js
  • npm
  • HTML

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

Please obtain all required items

Installation

Video installation

Click the picture or link bellow to watch!
Click Me To Watch! Video removed by owner.

https://youtu.be/3kCKnwuiHak Video removed by owner.

Quick Install (64-bit Systems)

  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. Download the executable here
  3. (Optional) Take a look at the Configs!

Manual Install (32-bit systems, and fallback for quick install):

  1. Download and install node.js version 16 or above and git. You need git even if you download the repository as zip because it is to install the dependencies via npm.
  2. Open a terminal then clone this repo then cd into folder:
 git clone https://github.com/themoonisacheese/2bored2wait
 cd 2bored2wait
  1. Run yarn to install the required libraries
  2. Start the program with yarn start.

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. docker run -d -p 8080:8080 -p 25565:25565 -e NODE_CONFIG='{"username": "account email", "accountType": "mojang or microsoft", "mcPassword": "your password", "BotToken": "your discord bot token"}' 2bored2wait/2bored2wait:latest. The docker image is automatically up to date after each push to this repo. Docker images are available for amd64 and arm64 among other platforms.
  3. Open a browser and navigate to http://localhost:8080
  4. Press the "Start queuing" button. The queue position indicator auto-updates, but sometimes it takes a while to start counting (like 1 min).
  5. Once the queue reaches a low number, connect to the Minecraft server at address localhost.
  6. 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 or you don't want your credentials in the bash history you will have to mount config/local.json manually.

Configuration

  • You can change all credentials and whether you want update messages by simply editing the values in local.json or deleting that file.
  • For the quick install, configs are located:
    • gnu+linux/macos: $HOME/.config/2bored2wait/
    • windows: C:\Users\USERNAME\AppData\Roaming\2bored2wait\Config\

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 want update messages then you need to type Y otherwise N. 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. Refer to Commands on how to use 2b2w from the console. Otherwise keep on reading for the web interface.
  5. Now open a browser and navigate to http://localhost: your web port here (default 8080).
  6. Press the "Start queuing" button. The queue position indicator auto-updates, but sometimes it takes a while to start counting (like 1 min).
  7. Once the queue reaches a low number, connect to the Minecraft server at address localhost.
  8. 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 simply typed in the console window.

  • Please note that the time zone for the calculations is based off your computer's time!

  • Here are some basic commands:

    • 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.
  • Type help for a full ist of commands

Roadmap and known issues

See the open issues for a list of proposed features (and 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 data. Otherwise you would fly in an empty world. However not all data will be resend. 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.

How to make a bug report

Try updating 2bored2wait, run npm update (if you are using the source code), and update your system.

โ€ข Give info in bug reports such as....

  • Output of npm list (if you are using the source code).
  • Version of program.
  • Other error messages.

Make a bug report here. Feel free to ask questions or add feature requests as well.

Addons

Auto-Update Allows you to have auto updates! REMOVED DUE TO 404

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b themoonisacheese/2bored2wait)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin themoonisacheese/2bored2wait)
  5. Open a Pull Request

License

Distributed under the GPL-3.0 License. See this for more information.

Testing

  • Run npm test to run test.js

2bored2wait's People

Contributors

averagecomet250 avatar baitinq avatar dependabot[bot] avatar dsetareh avatar edofullin avatar elisaado avatar etiaro avatar filipton avatar francescozucca avatar gislinielsen avatar hackermondev avatar hari01584 avatar l33m4n avatar martindevelopment avatar moondarker avatar mrgeorgen avatar nanospearing avatar nepnep21 avatar nickcat325 avatar polyfish0 avatar qualk avatar rekonnected avatar rob9315 avatar stefalce avatar thecolorman avatar themoonisacheese avatar whodiduexpect avatar wylie39 avatar xhendrikg avatar zillyhuhn 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

2bored2wait's Issues

[Suggestion] Instead of a proxy server, make the program hand everything to your client when the queue ends

Difficult to explain.

At the moment, the program works by being a proxy server, which is good, but also means that there is extra latency (especially if your running it off an external device) and caveats such as having disconnecting from the proxy not disconnect from your client.

Why not pass over the login key and the server connection hook to the client. I hope that explains it? Not sure how feasible it would be but it would definitely be an improvement.

Error while running queue

err Error: Request blocked by CloudFlare
at /home/2b2t/node_modules/yggdrasil/lib/utils.js:45:19
at /home/2b2t/node_modules/phin/lib/phin.min.js:1:1150
at processTicksAndRejections (internal/process/task_queues.js:97:5)

I installed it on my dedicated server.

Got this error

When I started the proxy. I typed the correct email and password, and i changed the port to 8087
and.. I got this this error when I started.

events.js:174
throw er; // Unhandled 'error' event
^

Error: listen EACCES: permission denied 0.0.0.0:25565
at Server.setupListenHandle [as _listen2] (net.js:1262:19)
at listenInCluster (net.js:1327:12)
at doListen (net.js:1460:7)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Server. (C:\Users\WinsVideo\Desktop\2bored2wait-master\node_modules\minecraft-protocol\src\server.js:45:12)
at Server.emit (events.js:198:13)
at emitErrorNT (net.js:1306:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node main.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:--\AppData\Roaming\npm-cache_logs\2020-02-22T11_46_48_592Z-debug.log

Anti-afk feature

I found out that the server (queueskip) actually have a anti-afk and I wanted to think thatโ€™s a good feature.

If you donโ€™t know what I Am talking about here is the flow chart:

Open Queue -> Finish Queue -> No players? <- Use anti afk <- If player logs on -> they play -> Finish? -> Quit the proxy.

Sorry if this flow chart is bad but anyways you can think about it.

Update edit: Removed โ€œwhile using the applicationโ€ since that sentence doesnโ€™t make sense.

Not joining queue

So I'm pretty sure I did everything correct, but when I press "Start queuing" it turns red with "Stop queuing" for a few seconds before it turns back to the "Start queuing". I tried waiting for a few minutes to see if the numbers eventually popped up, but they didn't.

Invalid credentials or password

Everytime i try to start the queue it just says
err Error: Invalid credentials. Invalid username or password. at /home/robinplom/2bored2wait-master/node_modules/yggdrasil/lib/utils.js:33:10 at IncomingMessage.<anonymous> (/home/robinplom/2bored2wait-master/node_modules/phin/lib/phin.compiled.js:1:2100) at IncomingMessage.emit (events.js:205:15) at endReadableNT (_stream_readable.js:1137:12) at processTicksAndRejections (internal/process/task_queues.js:84:9)

Now i haved logged into minecraft.net muliple times already but that jsut doesn't fix it..

suggestions

  • change the button of start queue, to a switch to enable or disable the queue.
  • add an auto reconnect option, if the server restart when queueing or when playing

Use raw data events instead of packets to improve performance

NMP provides raw data events instead of packet events which has a performance advantage since there's less processing of the packets, and since you're not using any of the data but just relaying it, it works perfectly.

As a side note, because you don't store and modify chunk data, a proxy of this type has to restart often or the backlog of stored packets gets too long for the client to process before it gets kicked, or even just takes too long.
EDIT: It looks like someone has worked on this for you #45
EDIT2: You still get the data, but in a raw form, being every packet is documented on wiki you can still access the data, just not in a serialized format, which is still faster.

Passwording the website

It might be a good suggestion to add a password in order to either access the website, or to click the "start queuing" button, forwarding the port to the internet means anybody could port scan you and go to the website and fiddle around with the button, and that just might not be something you want ๐Ÿ‘

Otherwise, thank you for such a wonderful program :)

Other people being able to join your server

Currently other people are able to connect to your server if they have the ip and port(since online-mode: false) and play as your account. You are able to do this even without using the correct username. To solve this I recommend putting online-mode to true and adding a whitelist.

General desync issues

I'm pretty sure this is what causes #2 and #21 but I can't manage to fix it.

right now I think 2 things are happening:

the first is that the player's entityID is not in sync with the servers, so when the player recieves packets ordering it to eg apply an effect, it applies it to a random entity instead of itself. This problem is compounded by the fact that the proxyClient's entityID seems to always be 0.

the second half of the problem is that the player recieves packets telling it to spawn in the overworld twice. This is a problem described at https://wiki.vg/Protocol#Respawn . Spawning the player in dimension 1 (the end) might fix this problem, but then the client thinks it's in the end until respawn. careful control of packet order might fix this, but the first half of the problem still exists.

Help is very much wanted, as I just spent a good part of my weekend trying to fix this without any shred of success.

npm issue

`dev:2bored2wait raizo$ npm start

[email protected] start /Users/raizo/Desktop/2bored2wait
node main.js

internal/modules/cjs/loader.js:775
throw err;
^

Error: Cannot find module 'lodash.merge'
Require stack:

  • /Users/raizo/Desktop/2bored2wait/node_modules/minecraft-protocol/src/transforms/serializer.js
  • /Users/raizo/Desktop/2bored2wait/node_modules/minecraft-protocol/src/client.js
  • /Users/raizo/Desktop/2bored2wait/node_modules/minecraft-protocol/src/index.js
  • /Users/raizo/Desktop/2bored2wait/main.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
    at Function.Module._load (internal/modules/cjs/loader.js:677:27)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at Object. (/Users/raizo/Desktop/2bored2wait/node_modules/minecraft-protocol/src/transforms/serializer.js:9:15)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Module.require (internal/modules/cjs/loader.js:830:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/Users/raizo/Desktop/2bored2wait/node_modules/minecraft-protocol/src/transforms/serializer.js',
    '/Users/raizo/Desktop/2bored2wait/node_modules/minecraft-protocol/src/client.js',
    '/Users/raizo/Desktop/2bored2wait/node_modules/minecraft-protocol/src/index.js',
    '/Users/raizo/Desktop/2bored2wait/main.js'
    ]
    }
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] start: node main.js
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

`

Getting this error

I started the proxy and entered my email and password but I recieved this error when I typed 'npm start'
events.js:180
throw er; // Unhandled 'error' event
^

Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:80' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node main.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\wang1\AppData\Roaming\npm-cache_logs\2020-02-23T03_03_20_599Z-debug.log

Error before even reaching login

When running npm start the following is displayed:

`> [email protected] start C:\Users\Zachary 2VeryIcey\,Applications\2bored2wait-master\2bored2wait-master
> node main.js

events.js:180
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:77:11) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:80' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node main.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`

Detect when queue is broken

So... there are situations like:

  • I was 240th or something like that and I instantly went to place 80th. It was going down to 60th, and I was stuck for over 10 minutes. Probably some bug, I reconnected.
  • I was maybe 80th again and I got 1st instantly. I didn't join for over 10 minutes. I disconnected.
  • some cases like just getting stuck, without any instant position change
    It happens to me sometimes both with the proxy and when I just use Impact. These anomalies should be detected and the proxy should begin queuing again.
    Sorry for poor English :|

Error when there is no queue

Hi, i've get this error when there was no queue so i gess he couldn't detect if he was in the queue or not (by getting the number of queue the guy are) . How can we fix that ?
Anyway, you did an awsome job :) Hope you can fix that
root@user:/home/user/www-server/2bored2wait# npm start

[email protected] start /home/user/www-server/2bored2wait
node main.js

end SocketClosed
Trying to reconnect
/home/user/www-server/2bored2wait/main.js:76
let positioninqueue = headermessage.text.split("\n")[5].substring(25);
^

TypeError: Cannot read property 'substring' of undefined
at Client.client.on (/home/user/www-server/2bored2wait/main.js:76:59)
at emitTwo (events.js:126:13)
at Client.emit (events.js:214:7)
at FullPacketParser.deserializer.on (/home/user/www-server/2bored2wait/node_modules/minecraft-protocol/src/client.js:86:12)
at emitOne (events.js:116:13)
at FullPacketParser.emit (events.js:211:7)
at addChunk (/home/user/www-server/2bored2wait/node_modules/readable-stream/lib/_stream_readable.js:298:12)
at readableAddChunk (/home/user/www-server/2bored2wait/node_modules/readable-stream/lib/_stream_readable.js:280:11)
at FullPacketParser.Readable.push (/home/user/www-server/2bored2wait/node_modules/readable-stream/lib/_stream_readable.js:241:10)
at FullPacketParser.Transform.push (/home/user/www-server/2bored2wait/node_modules/readable-stream/lib/_stream_transform.js:139:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node main.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-04-09T09_16_02_723Z-debug.log

Server crashes unexpectedly

Don't know what happened. I was 40 on 350 queue then saw this on site:
image.

Seemed a bit strange, so, decided to check the console.
This is the error:
err { Error: Serialization error for play.toServer : SizeOf error for name : undefined is not in the mappings value
at ProtoDef.sizeOfMapper (C:\Users\User\Creative Cloud Files\Desktop\2bored2wait-0.0.1\node_modules\protodef\src\datatypes\utils.js:59:34)
at ProtoDef.sizeOf (C:\Users\User\Creative Cloud Files\Desktop\2bored2wait-0.0.1\node_modules\protodef\src\protodef.js:127:31)
at tryDoc (C:\Users\User\Creative Cloud Files\Desktop\2bored2wait-0.0.1\node_modules\protodef\src\datatypes\structures.js:72:30)
at tryCatch (C:\Users\User\Creative Cloud Files\Desktop\2bored2wait-0.0.1\node_modules\protodef\src\utils.js:50:16)
at tryDoc (C:\Users\User\Creative Cloud Files\Desktop\2bored2wait-0.0.1\node_modules\protodef\src\utils.js:54:10)
at typeArgs.reduce (C:\Users\User\Creative Cloud Files\Desktop\2bored2wait-0.0.1\node_modules\protodef\src\datatypes\structures.js:72:12)
at Array.reduce ()
at ProtoDef.sizeOfContainer (C:\Users\User\Creative Cloud Files\Desktop\2bored2wait-0.0.1\node_modules\protodef\src\datatypes\structures.js:71:25)
at ProtoDef.sizeOf (C:\Users\User\Creative Cloud Files\Desktop\2bored2wait-0.0.1\node_modules\protodef\src\protodef.js:40:67)
at ProtoDef.sizeOf (C:\Users\User\Creative Cloud Files\Desktop\2bored2wait-0.0.1\node_modules\protodef\src\protodef.js:127:31) field: 'play.toServer' }
events.js:183
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE 0.0.0.0:25565
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at Server.setupListenHandle [as _listen2] (net.js:1355:14)
at listenInCluster (net.js:1396:12)
at doListen (net.js:1505:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

Invalid session id

err Error: Invalid credentials. Invalid username or password.
I've relogged in minecraft.net alot of times.

Minecraft skin doesn't show when connecting to 2b2t

When I wait out the queue utilizing this applicaiton, then connect to localhost as indicated in the README, my selected Minecraft skin doesn't show when I finally connect to the main server, instead it defaults to the default Steve or Alex skin.

Can't cast fishing rod

I've been autofishing and decided to use the proxy. When i log back in i have the fishing rod in my active hotbar slot. I can't right click to use the fishing rod.
I can use bows and eat food. I tried using other fishing rods but still no luck. I can't cast them either.

Add a listen-on-interface option

Can you please add an option to listen only on a specific interface (IP address), so you can only listen on 127.0.0.1 (aka. localhost) to prevent others from accessing your server?

tnx

Can't ride pig

So i just started using this script. The first thing i noticed is that hearts from gapple don't appear but that's not a big deal. The problem is when i right click a pig, nothing happens. After this i go on and chunks won't load. I have to press shift and then i get tp back to the pig with the animation as i was getting down the pig . In conclusion the game somehow thinks i'm on the pig but it doesn't show me on the pig.

LICENCE: can you provide more dynamic terms

Hello!

Currently the licence of this code is GPL, but that is some kind of restricting for me as it states that source code must always be available, since I am building a webapp using your code, I don't want to share all code I am using, mainly because of security by obscurity reasons, espacially because we're dealing with the salty 2b2t community that will try to find bugs in my code and exploit other users' credentials.

Can you change the licence to something that does not enforce me to share the source code? WTFPL would be the easiest but also bad for you (no attribution).

I am looking forward to hearing from you,
/sijanec

The "Restart the queue if you're not connected at the end of it" button doesn't work

So when I go to school and leave the queue running to hope that I'm in a lower number than before, since it keeps running, but when I come back, the queue is disconnected and I need to turn it on again.
Does this have something to do with server restarts or is it just a bug of some kind? And if it is because of restarts, how do I start it again while being absent?

unable to start react native project

react native project not running.

after running npm start with root access in ubntun 18.04
error

jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
Usually this happens when watchman isn't running. Create an empty .watchmanconfig file in your project's root folder or initialize a git or hg repository in your project.
Error: Watchman error: A non-recoverable condition has triggered. Watchman needs your help!
The triggering condition was at timestamp=1586080434: inotify-add-watch(/home/rsp/Desktop/FILEs/React Native/p2/node_modules/@babel/core/node_modules/debug) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
All requests will continue to fail with this message until you resolve
the underlying problem. You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch. Make sure watchman is running for this project. See https://facebook.github.io/watchman/docs/troubleshooting.html.
events.js:186
throw er; // Unhandled 'error' event
^

Error: A non-recoverable condition has triggered. Watchman needs your help!
The triggering condition was at timestamp=1586080434: inotify-add-watch(/home/rsp/Desktop/FILEs/React Native/p2/node_modules/@babel/core/node_modules/debug) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl
All requests will continue to fail with this message until you resolve
the underlying problem. You will find more information on fixing this at
https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch

at ChildProcess.<anonymous> (/home/rsp/Desktop/FILEs/React Native/p2/node_modules/fb-watchman/index.js:207:21)
at ChildProcess.emit (events.js:209:13)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:430:11)
at Socket.emit (events.js:209:13)
at Pipe.<anonymous> (net.js:588:12)

Emitted 'error' event on WatchmanWatcher instance at:
at Client. (/home/rsp/Desktop/FILEs/React Native/p2/node_modules/jest-haste-map/build/lib/WatchmanWatcher.js:130:10)
at Client.emit (events.js:209:13)
at ChildProcess. (/home/rsp/Desktop/FILEs/React Native/p2/node_modules/fb-watchman/index.js:214:12)
at ChildProcess.emit (events.js:209:13)
[... lines matching original stack trace ...]
at Pipe. (net.js:588:12) {
watchmanResponse: {
version: '4.9.0',
error: 'A non-recoverable condition has triggered. Watchman needs your help!\n' +
'The triggering condition was at timestamp=1586080434: inotify-add-watch(/home/rsp/Desktop/FILEs/React Native/p2/node_modules/@babel/core/node_modules/debug) -> The user limit on the total number of inotify watches was reached; increase the fs.inotify.max_user_watches sysctl\n' +
'All requests will continue to fail with this message until you resolve\n' +
'the underlying problem. You will find more information on fixing this at\n' +
'https://facebook.github.io/watchman/docs/troubleshooting.html#poison-inotify-add-watch\n'
}
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: react-native start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/rsp/.npm/_logs/2020-04-05T09_53_56_770Z-debug.log

log file

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/home/rsp/.nvm/versions/node/v12.9.0/bin/node',
1 verbose cli '/home/rsp/.nvm/versions/node/v12.9.0/bin/npm',
1 verbose cli 'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 info lifecycle [email protected]
start: [email protected]
7 verbose lifecycle [email protected]start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
start: PATH: /home/rsp/.nvm/versions/node/v12.9.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/rsp/Desktop/FILEs/React Native/p2/node_modules/.bin:/home/rsp/.nvm/versions/node/v12.9.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/rsp/Android/Sdk/emulator:/home/rsp/Android/Sdk/tools:/home/rsp/Android/Sdk/tools/bin:/home/rsp/Android/Sdk/platform-tools
9 verbose lifecycle [email protected]start: CWD: /home/rsp/Desktop/FILEs/React Native/p2
10 silly lifecycle [email protected]
start: Args: [ '-c', 'react-native start' ]
11 silly lifecycle [email protected]start: Returned: code: 1 signal: null
12 info lifecycle [email protected]
start: Failed to exec start script
13 verbose stack Error: [email protected] start: react-native start
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/home/rsp/.nvm/versions/node/v12.9.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:326:16)
13 verbose stack at EventEmitter.emit (events.js:209:13)
13 verbose stack at ChildProcess. (/home/rsp/.nvm/versions/node/v12.9.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:209:13)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/rsp/Desktop/FILEs/React Native/p2
16 verbose Linux 5.3.0-28-generic
17 verbose argv "/home/rsp/.nvm/versions/node/v12.9.0/bin/node" "/home/rsp/.nvm/versions/node/v12.9.0/bin/npm" "start"
18 verbose node v12.9.0
19 verbose npm v6.10.2
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: react-native start
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

i keep getting this error on discord.js

Error: Cannot find module 'sleep'
Require stack:

  • C:\Users\dfgot\Desktop\2lazy2wait-master\discordbot.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object. (C:\Users\dfgot\Desktop\2lazy2wait-master\discordbot.js:8:13)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ 'C:\Users\dfgot\Desktop\2lazy2wait-master\discordbot.js' ]

If the player doesn't connect to the proxy by the end of the queue, start over.

I would like to be able to run this on my Raspberry Pi at all times, so that when I want to join 2b2t I've already made some progress in the queue

  • Track position in queue
  • If the position in queue is 1 and player hasn't connected yet, disconnect and reconnect again.

This way, the moment I decide to join 2b2t I'll probably have already made some progress in the queue.

Attempt to join queue with button just resets the button and does not join queue.

I start it with "npm start" then go into the website loaded and press the start queue button after entering the password. Button just reverts to the original state and does not join the queue.

Error message:

err Error: querySrv EFORMERR _minecraft._tcp.2b2t.org
    at QueryReqWrap.onresolve [as oncomplete] (dns.js:206:19) {
  errno: 'EFORMERR',
  code: 'EFORMERR',
  syscall: 'querySrv',
  hostname: '_minecraft._tcp.2b2t.org'
}

How to install for servers (tutorial coming soon)

How i can run 2bored2wait on server, and after waiting queue i can connect from main PC to server's 2bored2wait, typing on main PC minecraft client server ip. (I need this, because after restarting main PC (On which this program is installed and opened) i am get disconnected) Sorry for so bad english.

Crash while queueing

The proxy crashed while I was queuing, unfortunately I don't know much else about what happened. It was in queue for about 4 hours, I think. Here is the terminal output:

Edit: after doing a bit of googling, this might have been caused by 2b2t crashing/restarting.

(node:29365) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.

> [email protected] start /home/pi/2b2w/2bored2wait
> node main.js

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE 0.0.0.0:25565
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at Server.setupListenHandle [as _listen2] (net.js:1367:14)
    at listenInCluster (net.js:1408:12)
    at doListen (net.js:1517:7)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

npm ERR! [email protected] start: `node main.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the 2bored2wait package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node main.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls 2bored2wait
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.19.66-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! cwd /home/pi/2b2w/2bored2wait
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/2b2w/2bored2wait/npm-debug.log
npm ERR! not ok code 0```

Can' interact with world. Chunks won't load.

Today I joined. I instantly walked through a nether portal to the overworld. I killed a few zombies and I walked a few hundred blocks away. I was only able to destroy one sand block then. I couldn't attack anything, I couldn't place any block and I couldn't destroy any block - broken blocks reappeared, placed blocks disappeared. New chunks didn't load, although loaded chunks seemed to be working (partially) correctly - new mobs spawned, but they didn't follow me. This issue may be related to using a hacked client - Impact.

Cool/Possible Idea?

I make Kubernetes Job containers that run this and give people a unique random SRV record for 2b3t and other que servers.

Would it be possible to put this on a remote server running nodejs and connect to it instead of localhost? I'd imagine a bit of lag unless the server was right next to 2b2t's, but seems like a cool idea.

If so I can provide a PR / endpoint later on.

I can't start queueing

err Error: getaddrinfo ENOTFOUND authserver.mojang.com
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26) {
errno: 'ENOTFOUND',
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'authserver.mojang.com'
}

error says this when i press start queueing.
what should i do?
(My secrets.json are right)

Hash password for website

Could you make it so the password you enter in the website is hashed because it is currently being send in plain text which isn't a good idea.

Use Websockets

Seriously, why doesn't this use Websockets?
They'd be easy to implement, modern and not spam the entire network log!

I'd personally love to implement that, if you're too lazy.

Disconnecting and reconnecting shows black queue screen but you are actually still playing

If you disconnect and reconnect to proxy server before 2b2t antiafk kicks you, you can still chat and you are still in the game, but there's a black (not 2b2t's but proxy's) queue screen and you can move, take damage, die, ... but you can't see a thing.

After reconnection to the proxy when I was testing this, I was in Nether and a Ghast killed me, I did not see it, but after I hit respawn, I was able to see again. It is a [bug] where the black screen is displayed when you join the queue server, it should be only in queue.

Another thing-> since proxy is already connected to 2b2t after client disconnection, it could also send some antiafkkick packets, such as arm swing or rotate and if you have 2bored2wait on a 24/7 up server, you will always be online and never have to wait in the queue.

Queueing randomly stops

While waiting in queue using this proxy, it randomly disconnects. not sure if that is a problem with 2b2t itself. Automatically reconnecting would be nice

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.