FragLand / terracord

:evergreen_tree: A Discord <-> Terraria bridge plugin for TShock
GNU General Public License v3.0
34 stars 14 forks source link

Unable to connect to Discord: Error converting value {null} to type 'Discord.Optional`1[System.String]'. #127

Closed STBlitzkrieg closed 3 years ago

STBlitzkrieg commented 3 years ago

Error log from server: https://ghostbin.co/paste/u9j7w

I've been working with a game service provider, BisectHosting, and I've run across this issue.

To preface this, I have a local instance of TShock running with the Terracord discord bridge that works flawlessly. I've even gone so far as to push my entire folder to the GSP and we always, without fail, run into the exact same error message.

Can anyone shed some light onto this? Thanks.

test

ldilley commented 3 years ago

Greetings, @JSomnia.

What version of Newtonsoft.Json.dll do you have in your ServerPlugins directory? I've seen a similar error occur when using an older version of the aforementioned DLL. See #103 for details.

Lastly, what .NET runtime are you using? I've also seen similar symptoms while using Mono (which is not supported by Discord.Net per the README.md except under certain conditions). People have reported success using Mono 6.8 with the Terracord.dll that targets the net46 or net461 framework rather than netstandard2.0.

STBlitzkrieg commented 3 years ago

I appreciate the prompt response! I can confirm that it's not the Newtonsoft.Json.dll.

However, my GSP just informed me that they are indeed using Mono. I tried to compile my own .dlls from the repo and they seemed to just break entirely. I made sure I had all the assemblies required. I'm sure it's something I'm doing wrong. Basically, if I can't build from solution for .Net, what hope do I have of figuring out how to do it for mono?

I think it would probably be a waste of your time to walk me through it, too, considering how many issues I've had attempting to do it today. I think it's safe to say it's not a bug. I'm quite new at all of this so I realized my error after I posted it with the label.

ldilley commented 3 years ago

The good news is that the latest release zip archive (1.2.2) contains a Terracord.dll that targets net461. As a result, there is no need to build from source in this case. You have a few options from this point:

  1. See if your hosting provider will allow you to use a newer version of Mono (>=6.8) or a different runtime such as .NET Framework >=4.7, .NET Core 3.x, or .NET 5.

  2. Swap to a hosting provider that does not use Mono (or offers at least version 6.8).

  3. Spin up a VPS where you control the operating system and the .NET implementation.

  4. If you're comfortable with Docker, check out https://github.com/Didstopia/terraria-server as an alternative. The author has a working TShock and Terracord configuration running under Mono within a Linux container.

STBlitzkrieg commented 3 years ago

Those are some good options to explore. I'm sure the first 2 would probably be feasible, as my GSP works with me pretty closely, so I'm sure we could figure something out. I'll get on that and see if I can get anywhere with them.

You seem pretty knowledgeable about this topic in general, would you mind pointing me in the right direction about some thing TShock related? I would have posted in a discussion section if there were one here.

https://github.com/Pryaxis/TShock/discussions/2227

ldilley commented 3 years ago

Option 1 is certainly doable if you want to stay with your existing host. It is also helpful that you work closely with your provider. If you are comfortable installing and administering the operating system (*BSD, Linux, or Windows), you could always host your own (option 3). VPS providers such as Vultr support running Windows Server and have datacenters all over the world.

This project has historically used Discord for discussions. The issue system also contains a label for questions. I am open to suggestions however, so I've created #129 to enable discussions for this project. We'll see if it gets any use...

Regarding Pryaxis/TShock#2227, I am not sure what the cause for this behavior is unfortunately. We'll see if someone replies.

STBlitzkrieg commented 3 years ago

Thank you for all of the information. I don't know that anyone will reply, and until they do, TShock is effectively unusable for me. Therefore, I can't make use of this. However, the provider is working with me on the mono situation, so that's great news.