Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing error with IPv6 addresses in CnCNetTunnel #642

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

11EJDE11
Copy link
Contributor

I saw in my logs a parsing error when encountering tunnels with IPV6 addresses. I am assuming the fix is to parse these correctly rather than discard tunnels with IPV6 addresses (I haven't tried connecting to any so don't know if they cause errors).

For reference, the error that was appearing in my logs:
21.01. 19:30:52.509 Fetching tunnel server info.
21.01. 19:30:52.824 Parsing tunnel information failed: System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at DTAClient.Domain.Multiplayer.CnCNet.CnCNetTunnel.Parse(String str) in C:\Dev\xna-cncnet-client\DXMainClient\Domain\Multiplayer\CnCNet\CnCNetTunnel.cs:line 39
Parsed string: 240e:33d:343:bf80::1017:50000;China;CN;yuki;0;0;200;0;0;0;2;0

Copy link

github-actions bot commented Jan 21, 2025

Nightly build for this pull request:

@11EJDE11
Copy link
Contributor Author

I've made some additional fixups. At the limit of what I can do now as IPV6 in general doesn't work for me.

@Metadorius
Copy link
Member

Does the tunnel get ignored if it's IPv6? AFAIK IPv6 tunnels are not supported by our spawner ATM.

@11EJDE11
Copy link
Contributor Author

Yeah it gets ignored. You can set a game to an IPV6 tunnel but it won't launch (you get prompt to change the tunnel) and won't show for other players (afaik because it fails with the parsing).

@Metadorius
Copy link
Member

I don't think it should be shown then if it can't be used. It's a bad UX to show stuff that is not usable in this case.

@11EJDE11
Copy link
Contributor Author

Sorry, forgot IPV6 doesn't work for me in general - that'd be why I get the prompt to change tunnel. Perhaps it would work for others with this PR.

@SadPencil SadPencil changed the title Fix parsing error with IPV6 addresses in CnCNetTunnel Fix parsing error with IPv6 addresses in CnCNetTunnel Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants