fixed reconnecting crashes
This commit is contained in:
12
README.md
12
README.md
@ -21,7 +21,7 @@ A fork of the popular proxy to wait out 2b2t.org's way too long queue. [2lazy2wa
|
||||
|
||||
# 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'
|
||||
2. Run `npm start`
|
||||
3. Your bot should be online now, in discord it should show up with "Queue stopped."
|
||||
4. See below for commands on how to start the queue.
|
||||
5. You can access the original 2bored2wait web interface from http://localhost
|
||||
@ -30,11 +30,11 @@ A fork of the popular proxy to wait out 2b2t.org's way too long queue. [2lazy2wa
|
||||
|
||||
# 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 at 8:00
|
||||
- 'update' will send an update to the current channel with your position and ETA.
|
||||
- 'stop' will stop the queue.
|
||||
- `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 at 8:00
|
||||
- `update` will send an update to the current channel with your position and ETA.
|
||||
- `stop` will stop the queue.
|
||||
|
||||
# Forewarning
|
||||
Do not give your secrets.json file to anyone under any circumstances.
|
||||
|
||||
@ -14,11 +14,11 @@
|
||||
"notConnectedQueueEnd": true // restart the queue if you are not connect at the end of it
|
||||
},
|
||||
"minecraftserver": { // the server you want to connect. Make not much sense to change it, was just added for development purpose
|
||||
"hostname": "2b2t.org",
|
||||
"hostname": "localhost",
|
||||
"port": 25565,
|
||||
"renderDistance": 8,
|
||||
"version": "1.12.2",
|
||||
"onlinemode": true, // chunk caching does not work correctly if set to false
|
||||
"onlinemode": false, // chunk caching does not work correctly if set to false
|
||||
"username": "lol" // the username to use if onlinemode is false
|
||||
},
|
||||
"notification": { // sends a message via discord if the place in the queue reaches the specified number
|
||||
|
||||
@ -119,7 +119,6 @@ function join() {
|
||||
let headermessage = JSON.parse(data.header);
|
||||
let positioninqueue = headermessage.text.split("\n")[5].substring(25);
|
||||
webserver.queuePlace = positioninqueue; // update info on the web page
|
||||
console.log(positioninqueue);
|
||||
if (webserver.queuePlace !== "None" && lastQueuePlace !== webserver.queuePlace) {
|
||||
if (!totalWaitTime) {
|
||||
totalWaitTime = Math.pow(positioninqueue / 35.4, 2 / 3);
|
||||
@ -392,6 +391,7 @@ function userInput(cmd, DiscordOrigin, discordMsg) {
|
||||
sendDiscordMsg(discordMsg.channel, "Timer", "Queue is starting at " + starttimestring);
|
||||
} else console.log("Queue is starting at " + starttimestring);
|
||||
} else if (/^play (\d|[0-1]\d|2[0-3]):[0-5]\d$/.test(cmd)) {
|
||||
timeStringtoDateTime(cmd);
|
||||
calcTime(cmd);
|
||||
let output = "The perfect time to start the will be calculated, so you play at " + starttimestring;
|
||||
if (DiscordOrigin) sendDiscordMsg(discordMsg.channel, "time calculator", output);
|
||||
@ -475,4 +475,4 @@ module.exports = {
|
||||
stop: function () {
|
||||
stop();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user