i fixed the kaboom ploblem which took ages to figure out

This commit is contained in:
ChomeNS 2022-11-17 14:46:04 +07:00
parent 3f10357d94
commit 963b627219
5 changed files with 9 additions and 15 deletions

View file

@ -58,27 +58,27 @@ module.exports = {
{ {
'host': 'play.kaboom.pw', 'host': 'play.kaboom.pw',
'port': 25565, 'port': 25565,
'kaboom': false, 'kaboom': true,
}, },
{ {
'host': 'sus.shhnowisnottheti.me', 'host': 'sus.shhnowisnottheti.me',
'port': 25565, 'port': 25565,
'kaboom': false, 'kaboom': true,
}, },
{ {
'host': 'kitsune.icu', 'host': 'kitsune.icu',
'port': 25565, 'port': 25565,
'kaboom': false, 'kaboom': true,
}, },
{ {
'host': '71.179.136.66', 'host': '71.179.136.66',
'port': 25565, 'port': 25565,
'kaboom': false, 'kaboom': true,
}, },
// { // {
// 'host': 'mc.chomens41793.ga', // 'host': 'mc.chomens41793.ga',
// 'port': 25565, // 'port': 25565,
// 'kaboom': true, // 'kaboom': false,
// }, // },
], ],
}; };

View file

@ -48,7 +48,7 @@ function inject(bot, dcclient, config) {
z: core.start.z + relativePosition.z, z: core.start.z + relativePosition.z,
}; };
if (kaboom) bot.write('update_command_block', {location, command: command.substring(0, 32767), mode: 0, flags: 0}); if (!kaboom) bot.write('update_command_block', {location, command: command.substring(0, 32767), mode: 0, flags: 0});
bot.write('update_command_block', {location, command: command.substring(0, 32767), mode: kaboom ? 2 : 1, flags: 0b100}); bot.write('update_command_block', {location, command: command.substring(0, 32767), mode: kaboom ? 2 : 1, flags: 0b100});
} catch (e) { } catch (e) {
bot.console.error(e); bot.console.error(e);
@ -126,7 +126,7 @@ function inject(bot, dcclient, config) {
// if (core.start === packet.chunkCoordinates || core.end === packet.chunkCoordinates) fillCore(); // if (core.start === packet.chunkCoordinates || core.end === packet.chunkCoordinates) fillCore();
// }); // });
bot.on('end', () => { bot.once('end', () => {
clearInterval(interval); clearInterval(interval);
}); });

View file

@ -50,23 +50,17 @@ function inject(bot, dcclient, config) {
targetClient.on('end', () => { targetClient.on('end', () => {
targetClient.end(); targetClient.end();
targetClient.removeAllListeners();
client.removeAllListeners();
endedTarget = true; endedTarget = true;
}); });
client.on('end', function() { client.on('end', function() {
endedClient = true; endedClient = true;
targetClient.end(); targetClient.end();
targetClient.removeAllListeners();
client.removeAllListeners();
bot.console.info(`[Proxy] ${client.username} ended`); bot.console.info(`[Proxy] ${client.username} ended`);
}); });
client.on('error', function() { client.on('error', function() {
endedClient = true; endedClient = true;
targetClient.removeAllListeners();
client.removeAllListeners();
bot.console.info(`[Proxy] ${client.username} got error`); bot.console.info(`[Proxy] ${client.username} got error`);
}); });

View file

@ -34,7 +34,7 @@ function inject(bot, client, targetClient, config) {
}); });
const interval = setInterval(() => { const interval = setInterval(() => {
if (bot.options.host !== '0.tcp.ap.ngrok.io') { if (bot.options.kaboom) {
if (!op && config.self_care.op) targetClient.chat('/minecraft:op @s[type=player]'); if (!op && config.self_care.op) targetClient.chat('/minecraft:op @s[type=player]');
if (!cspy && config.self_care.cspy) targetClient.chat('/commandspy:commandspy on'); if (!cspy && config.self_care.cspy) targetClient.chat('/commandspy:commandspy on');
} }

View file

@ -55,7 +55,7 @@ function inject(bot, dcclient, config) {
}); });
const interval = setInterval(() => { const interval = setInterval(() => {
if (bot.options.host !== '0.tcp.ap.ngrok.io') { if (bot.options.kaboom) {
if (!prefix && config.self_care.prefix) bot.chat('/extras:prefix &8[&eChomeNS Bot&8]'); if (!prefix && config.self_care.prefix) bot.chat('/extras:prefix &8[&eChomeNS Bot&8]');
if (!op && config.self_care.op) bot.chat('/minecraft:op @s[type=player]'); if (!op && config.self_care.op) bot.chat('/minecraft:op @s[type=player]');
if (!cspy && config.self_care.cspy) bot.chat('/commandspy:commandspy on'); if (!cspy && config.self_care.cspy) bot.chat('/commandspy:commandspy on');