Exiled-Team / DiscordIntegration

GNU General Public License v3.0
13 stars 36 forks source link

[BUG] Bot receive corrupted JSON data #99

Closed ITeMbI4 closed 2 years ago

ITeMbI4 commented 2 years ago

Describe the bug Precondition: I have my own fork of discord integration (this is the same, but with more debug)

Sometimes bot receive corrupted JSON data from SCP server like: {"$type":"SCP_Discord.RemoteCommand, SCPDi or {"$type":"SCP_Discord.RemoteCommand, SCPDiscord","action":0,"parameters":[0,":tada: **Adjust player Korna (REDACTED STEAM@ste

Tested within localhost!

To Reproduce Steps to reproduce the behavior:

  1. Run SCP server with installed DiscordIntegration
  2. Run SCP Bot
  3. Wait when corrupted data appears (it's random)

Expected behavior Bot always receive correct and full data

Server logs Please include a pastebin of your localadmin log file (or both MA_log and SCP_log files if you use MultiAdmin) from the time in which the bug occured

EXILED Version ("latest" is not a version): 5.2.1

ITeMbI4 commented 2 years ago

I have added this to catch in OnReceived method in bot image

image

joker-119 commented 2 years ago

Interesting. It's not corrupted, it's just receiving the data in partial blocks for some reason, but also, the type SCP_Discord.RemoteCommand is not valid. Make sure you've updated the plugin aswell, because in none of my testing has DiscordIntegration sent partial info in the tcp stream before. Like literally in the entirety of EXILED DiscordIntegration I've never seen it send a partial message to the bot, and the type shown here makes me think you're just using the wrong plugin, as the SCPDiscord type has also never existing in DI.