godarklight / DarkMultiPlayer

DarkMultiPlayer - A multiplayer mod for Kerbal Space Program
MIT License
278 stars 120 forks source link

Add setting to disable IPv6 support #481

Open Rene-Sackers opened 1 year ago

Rene-Sackers commented 1 year ago

I was trying to run DMP in a Docker container, but it kept throwing System.NotSupportedException: This protocol version is not supported. on TCPServer.Server.DualMode = true;.
If your system does not support IPv6, which my Docker server seems to not, you cannot start the server.

I added a setting to disable IPv6 to circumvent this. The default behavior is the same as before, only a setting was added to disable it.

As commented in the code, I'm not sure why, but if I do

TCPServer.Server.DualMode = Settings.settingsStore.supportIpv6;

even if it was set to false, it would crash. So I had to add an if statement that only set it to true if IPv6 is enabled, and doesn't do anything if it's not.