LakeYS / Dishorde

A Discord bridge bot for 7 Days to Die. Dishorde integrates a dedicated server with Discord, allowing players to access the game's chat from any device or location. Powered by discord.js.
http://lakeys.net/dishorde
MIT License
47 stars 27 forks source link

Some msgs are not sent to the server until a followup msg is sent #110

Closed davcomNZ closed 2 years ago

davcomNZ commented 3 years ago

Sometimes, a msg sent from the Discord channel will not appear ingame, until a 2nd or subsequent msg is sent (usually from the PC that issued the msg that has not yet appeared in-chat.)

Closest association we can make is that this seems to occur predominantly from the PC on which the chatbot is running when a msg is sent.

Other than that we have no idea what's causing this.

LakeYS commented 3 years ago

Will do some testing soon. Are you able to post your exact config with sensitive information removed?

davcomNZ commented 3 years ago

Hi Lake, you're after the serverconfig.xml ? or the chatbot config ?

davcomNZ commented 3 years ago

FYI. Chatbot is running on a Linux PC (Ubuntu 20.04).

LakeYS commented 3 years ago

The bot's config. The exact version of the game (via 7d!version) will also help

davcomNZ commented 3 years ago

7DTD Discord chatbot Config.json Selection_034

[14:50] BOT 7DTD-ChatBot: Game version: Alpha 19.5 (b60) Compatibility Version: Alpha 19.5

davcomNZ commented 3 years ago

FWIW, I have had a persistent Telnet error when a command was issued through the providers TCAdmin which I contacted TCAdmin about since my provider was unable to provide a fix, which TCAdmin responded to by saying "the error is safe to ignore but this is fixed in TCAdmin 2.0.165.1". I have no idea whether that issue has a bearing on the chatbot operation but as they both use Telnet felt it worth mentioning. 20210527_Telnet_IOException_EVERY_time_a_command_is_issued_in_web_console.pdf

LakeYS commented 3 years ago

I have not yet been able to replicate your issue -- unfortunately, there have been a lot of reports of compatibility issues between 7DTD-Discord and other server utilities. The cause may be a conflict with TCAdmin.

I will be doing more testing soon to look into a fix for this. In the meantime, if you can catch the problem with the log-telnet option enabled, a console log of this from the bot may be helpful.

davcomNZ commented 3 years ago

I have been using the log-telnet option since starting with 7DTD-Discord but there has been no obvious error message related to 7DTD-Discord in all that time. While I can see a direct correlation to the Telnet errors that do show when issuing a command via TCAdmin, nothing appears in the logs at all with respect to when messages don't get displayed ingame. There is 1 other admin in our Discord channel for the bot and he has advised me when messages appear in Discord but haven't yet appeared ingame via the bot ( I often use 7DTD-Discord bot to communicate with players when I'm not ingame myself). None of the messages are lost; the bot seems to store them and send them on when there's further messages queuing up behind so it looks like the bot does know about every message but for whatever reason isn't able to push them ingame straight away. We've had occasions when a single message may not have got through for literally hours if there was no following messages to force either the bot ? or the game ? to interact with the bots message queue.

LakeYS commented 3 years ago

I see. From the sound of it, the messages are getting stuck in a buffer. The strange part of this is: 7DTD-Discord creates a buffer for messages from 7DTD->Discord, but not inverse from Discord->7DTD, which is where the problem appears to lie.

For best results, also make sure the bot is updated to the latest release (issued a few days ago) and the latest LTS version of Node.js -- some users experiencing similar issues have reported this fixing it. Ideally, we want to try to reproduce the problem on the latest release, with the latest version of Node.js installed on the system.

davcomNZ commented 3 years ago

I did note that 1.7.3 has been released just prior to my last post. Is the update procedure as simple as copying away the config.json, wiping the folder contents and replacing with all of 1.7.3 then copy back the old config.json ? I'll check if a node.js update is available.

LakeYS commented 3 years ago

Yes, should be simple as that.

davcomNZ commented 3 years ago

Hmmm. Seems I have managed to bork things magnificently. Wiped all of my root 7DTD-Discord folder contents as intended but the sub-folder "node_modules" is no longer present in my bot root folder. Get back to you when I have some semblance of order :) Node.js version is v6.14.13 (installed via Snap which advises no Node updates available)

LakeYS commented 3 years ago

*Correction on before, you also need to re-run npm install after replacing files

davcomNZ commented 3 years ago

Downloaded "v1.7.3" (7DTD-Discord.tar.gz) under Assets on Github, extracted to 7DTD-Discord folder after wiping all files/folders within, copied config.json back, ran npm install. Bot is up and connected to 7DTD server but still showing v1.7.2 running not v1.7.3.

davcomNZ commented 3 years ago

There was a notice of a major NPM update, from v6.14.13 to v7.19.0, which has also been done but repeating the bot upgrade process still results in the console showing that it's v1.7.2 that's running.

davcomNZ commented 3 years ago

Downloaded v1.7.3 from Github 3 times. First 2 installed against npm 6.14.13 and last against npm 7.19.0. Selection_036

davcomNZ commented 3 years ago

A reboot fixed the issue with v1.7.3 not showing as running.

LakeYS commented 3 years ago

For the release version number, you can now re-download to receive the correct version number. My apologies for the mix-up.

davcomNZ commented 3 years ago

All good now thanks. Was a little premature in saying a reboot fixed it because on further checking at the time no it hadn't but is now.

LakeYS commented 3 years ago

Good to hear. Has the new update resolved the follow-up message problem?

davcomNZ commented 3 years ago

Left it for a few days to see if the message problem was resolved but our server has gone incredibly quiet so not able to confirm at this time. Will post again if we do encounter it.

LakeYS commented 2 years ago

Closing for now. Feel free to comment if further assistance is needed.