levrik / node-modern-rcon

A modern RCON client implementation written in ES2015
MIT License
29 stars 5 forks source link

Responded id did not match sent id #6

Open Jerseyetr opened 5 years ago

Jerseyetr commented 5 years ago

I have plugged in the example code to an existing Discord bot shell I use for my other projects. When executing the bot i get this error, weirdest part is, if I run the GetChat command (ARK server) it does not get chat response. Only 2 times has it worked, and I believe it only worked because I sent a test message in my server right as I restarted the bot.

Server received, But no response!!

C:\Users\jerse\Documents\Discord Bots\Discord-Bot-master\node_modules\modern-rcon\rcon.js:100 throw new RconError('Responded id did not match sent id'); ^ RconError: Responded id did not match sent id at Rcon._handleResponse (C:\Users\jerse\Documents\Discord Bots\Discord-Bot-master\node_modules\modern-rcon\rcon.js:100:13) at Socket.emit (events.js:189:13) at addChunk (_stream_readable.js:284:12) at readableAddChunk (_stream_readable.js:265:11) at Socket.Readable.push (_stream_readable.js:220:10) at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17) [nodemon] app crashed - waiting for file changes before starting...

This is my code block I am running.

client.once('ready', () => {
    console.log('**Ready!**');
    console.log('=============================');
    console.log('        Version 1.3');
    console.log('=============================');
    client.user.setActivity('type !help to start');

    rcon.connect().then(() => {
        return rcon.send('GetChat'); // That's a command for Minecraft
            }).then(res => {
              console.log(res);
            }).then(() => {
              return rcon.disconnect();
            });

});
Jerseyetr commented 5 years ago

Happens with all commands I use, or don't use. Just simply opening a connection throws this error.

levrik commented 5 years ago

Which version of Minecraft are you using? Is the GetChat command coming from some server-side plugin? I couldn't find anything about it.

levrik commented 5 years ago

Ah. Sorry. It's about an ARK server. I got confused by the // That's a command for Minecraft in the example code. This library is tested with Minecraft only (should be mentioned in the README). Since I don't own ARK I can't troubleshoot this issue. Can you please debug the library and try to fix it by yourself? If you need help understanding the code, please let me know.

PerseusArkouda commented 3 years ago

Any updates on this? I'm also trying to use it on Ark servers and have the same behavior.