Eco-DiscordLink / EcoDiscordPlugin

A plugin that interfaces Eco Global Survival's server with Discord
GNU Affero General Public License v3.0
33 stars 15 forks source link

Spamming the feeds on Discord #72

Closed jus61 closed 2 years ago

jus61 commented 2 years ago

-Set a chat channel on Discord, link it to DiscordLink in Duplex mode. -Restart plugin from GUI. -Type a message on either end (first restart might still work correctly). -Restart plugin and type a message again (Rate limit spam starts showing up on server console, double the amount of messages start appearing ingame/discord). -The more restarts, the higher the spam is and eventually a server crash.

The pictures are not from me but from the Discord!:

eco2 eco1

MonzUn commented 2 years ago

Thanks! Excellent that you included repro steps :)

I'm aware of the issue and I'll get on it when I've resolved hardware issues with my server and I get my dev PC back from server duty!

Enel300 commented 2 years ago

@MonzUn Hello from a Daniel to a Daniel,

I can confirm this error. After successful setup, every message is spammed almost endlessly. I have to revoke the bot's rights. It does not stop.

Please fix it as soon as possible! This makes it impossible to use the bot effectively.

Best regards

MonzUn commented 2 years ago

I'll fix it when I am able to and feel that I have the time. I provide support for this mod as a hobby project on my free time without compensation, so I won't allow it to add stress.

The STR includes restarting the plugin, so working around it should be trivial.

Enel300 commented 2 years ago

I'll fix it when I am able to and feel that I have the time. I provide support for this mod as a hobby project on my free time without compensation, so I won't allow it to add stress.

The STR includes restarting the plugin, so working around it should be trivial.

All good. Don't stress, but it would be nice if it wasn't fixed next month ;-) You have developed a helpful tool. I use it to track the chat when I'm offline. I am grateful for that.

I have restarted. Problem still exists. Or do you mean another restart?

MonzUn commented 2 years ago

Does it persist over a server restart? Because plugin restarts seem to be the cause according to the repro steps OP posted.

I should hopefully have my dev environment back in 2 weeks or so at least.

Enel300 commented 2 years ago

Does it persist over a server restart? Because plugin restarts seem to be the cause according to the repro steps OP posted.

I should hopefully have my dev environment back in 2 weeks or so at least.

As if by magic, it now works. No more spam. I restarted the plugin, I did the same thing a few days ago. Has brought nothing. Great! I will continue to monitor.

Enel300 commented 2 years ago

@MonzUn

Hey Daniel,

how can I deactivate the TradeWatcherFeed for the Discord server? We don't necessarily need to see who sold how much, when and where. The Discord channel gets a bit cluttered with the messages. It's enough if we can call up the functions via command.

Is it possible to deactivate the feed globally for everyone or is this only possible locally?

With "RemoveTradeWatcherFeed" I can only deactivate the feed for individual users who have subscribed to the feed, but how can I turn it off globally for everyone?

Best regards

MonzUn commented 2 years ago

Yeah, Discord dropping the connection from their end is relatively common and when that happens, After looking at the code I suspect it might also trigger the issue.

Everyone activates the watchers individually and everyone deativates them individually. The feature isn't tied to any discord server or conventional channel, but to the users.

Since watchers only send to the people who have activated them, only those users can deactivate them. The only way to do it as an admin would be to remove them from the TradeWatchers from DlWorldData.json file (in Storage/Mods/DiscordLink) while the server is off.