Skip to content

Internet Match does not work with IPv6 #226

@derhass

Description

@derhass

The internet match IP/password field currently allows only entering IPv4 addresses. However, hostnames are also used and resolved. However, if a hostname gets resolved to an IPv6 address, the game crashes:

Unhandled Exception detected: SocketException: An address incompatible with the requested protocol was used

(Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy)
System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP)
System.Net.Sockets.UdpClient.DoConnect (System.Net.IPEndPoint endPoint)


(Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

SocketException: An address incompatible with the requested protocol was used
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.UdpClient.DoConnect (System.Net.IPEndPoint endPoint) [0x00000] in <filename unknown>:0

(Filename:  Line: -1)

Unhandled Exception detected: NullReferenceException: Object reference not set to an instance of an object

(Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

LocalLANClient.DoTick () <0x000fa>
NetworkMatch.NetSystemDoTick () <0x004e4>
NetworkMatch.Update () <0x00033>
Overload.NetworkManager.Update () <0x0003b>
(wrapper dynamic-method) Overload.GameManager.Overload.GameManager.Update_Patch2 (Overload.GameManager) <0x0059e>


(Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

NullReferenceException: Object reference not set to an instance of an object
at LocalLANClient.DoTick () <0x000fa>
at NetworkMatch.NetSystemDoTick () <0x004e4>
at NetworkMatch.Update () <0x00033>
at Overload.NetworkManager.Update () <0x0003b>
at (wrapper dynamic-method) Overload.GameManager.Overload.GameManager.Update_Patch2 (Overload.GameManager) <0x0059e>


(Filename:  Line: -1)

Unhandled Exception detected: NullReferenceException: Object reference not set to an instance of an object

(Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

LocalLANClient.DoTick () <0x000fa>
NetworkMatch.NetSystemDoTick () <0x004e4>
NetworkMatch.Update () <0x00033>
Overload.NetworkManager.Update () <0x0003b>
(wrapper dynamic-method) Overload.GameManager.Overload.GameManager.Update_Patch2 (Overload.GameManager) <0x0059e>


(Filename: /home/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

As a quick improvement, I added a small patch in PR #225 which will prefer an IPv4 if multiple addresses are returned by the DNS.

However, in the long run, it would be nice to see if we could make olmod internet games work with IPv6 natively. It's not clear which changes this might require, and it it is feasible at all...

Metadata

Metadata

Assignees

No one assigned

    Labels

    MultiplayerGeneral multiplayer issues.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions