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

LAN/WAN not working #396

Closed
JAEG99 opened this issue May 23, 2024 · 13 comments
Closed

LAN/WAN not working #396

JAEG99 opened this issue May 23, 2024 · 13 comments

Comments

@JAEG99
Copy link

JAEG99 commented May 23, 2024

Spent a few hours with a friend trying to get WAN and LAN working (LAN with Hamachi) but constant loading connecting screen. It would be great if someone made a video or a very detailed guide with how the host and the people wanting to connect to the host set it up, would be a massive help.

@Drake10177
Copy link

same

@Toxic1594
Copy link

ye same we have to wait for a fix

@macsek1911
Copy link

macsek1911 commented May 26, 2024

I spent the last few hours debugging this. The server appears to function correctly and the problem is with the client.

When you set ClientSettings.json -> BaseIP to "localhost" on the same machine as the master and launch the client, everything appears to be working correctly.

BUT setting ClientSettings.json -> BaseIP to anything except "localhost" or "127.0.0.1" triggers unexpected behaviour in the client that causes the following:

  • Network traffic on port 4988 appears to be functional
  • Client hangs on the black connecting screen
  • Network traffic on port 4989 is totally absent

Making everything even more confusing, adding an arbitrary entry to the hosts file that points to 127.0.0.1 and setting that as the BaseIP also causes the client to fail sending data on 4989

I toyed around with the source and Console.WriteLine'd the shit out of it but I didn't catch anything obviously wrong.

The hacky solution I came up with in the meantime:

  • Set up both the client and the server for WAN as described by PvP.md
  • Both players set ClientSettings.json -> BaseIP to "localhost" instead of the WAN IP of the master server. The player hosting should be able to connect.
  • The other player runs the following commands in an elevated cmd.exe to set up a proxy to the master server:
netsh interface portproxy add v4tov4 listenport=4989 connectaddress=<ip of hosting player> connectport=4989 127.0.0.1 protocol=tcp
netsh interface portproxy add v4tov4 listenport=4988 connectaddress=<ip of hosting player> connectport=4988 127.0.0.1 protocol=tcp

This setup works for me. May also fix #397 #387 #388 #393

@JAEG99
Copy link
Author

JAEG99 commented May 26, 2024

Thank you! I will have to give it ago!

@DidYouTryThis
Copy link

[ERROR] Failed to bind to http://*:4989/ (ensure the program isn't already running, or try running as admin)

Any help on this..?

@JAEG99
Copy link
Author

JAEG99 commented May 26, 2024

That is also what I got, going to try the method above, just need to not be lazy but that is difficult for me XD I will let you know if it does resolve it

@pixeltris
Copy link
Owner

@macsek1911 the connection on 4988 is custom code so isn't impacted. The latest client update to Master Duel bumped the Unity version which possibly has some new configuration of what I think is curl which fails on any non localhost http url. https works but the web server in this project isn't suitable for easy configuration and I'd need to hook the clients cert validation and I'm not 100% sure where that even happens. So I will most likely proxy in a similar way to what you're doing with netsh but embedded into the client.

@Toxic1594
Copy link

I spent the last few hours debugging this. The server appears to function correctly and the problem is with the client.

When you set ClientSettings.json -> BaseIP to "localhost" on the same machine as the master and launch the client, everything appears to be working correctly.

BUT setting ClientSettings.json -> BaseIP to anything except "localhost" or "127.0.0.1" triggers unexpected behaviour in the client that causes the following:

* Network traffic on port 4988 appears to be functional

* Client hangs on the black connecting screen

* Network traffic on port 4989 is **totally absent**

Making everything even more confusing, adding an arbitrary entry to the hosts file that points to 127.0.0.1 and setting that as the BaseIP also causes the client to fail sending data on 4989

I toyed around with the source and Console.WriteLine'd the shit out of it but I didn't catch anything obviously wrong.

The hacky solution I came up with in the meantime:

* Set up both the client and the server for WAN as described by [PvP.md](https://github.com/pixeltris/YgoMaster/blob/master/Docs/PvP.md)

* Both players set  **ClientSettings.json -> BaseIP** to "localhost" instead of the WAN IP of the master server. The player hosting should be able to connect.

* The other player runs the following commands in an elevated cmd.exe to set up a proxy to the master server:
netsh interface portproxy add v4tov4 listenport=4989 connectaddress=<ip of hosting player> connectport=4989 127.0.0.1 protocol=tcp
netsh interface portproxy add v4tov4 listenport=4988 connectaddress=<ip of hosting player> connectport=4988 127.0.0.1 protocol=tcp

This setup works for me. May also fix #397 #387 #388 #393

love you man me and my friend was waiting since 1 week to play the whole night with all cards <3 , so in theory i can also put this on a windows server and just have to set this on 2 pc´s as proxy , or am i wrong ?

@macsek1911
Copy link

@pixeltris
Thanks for the explanation. I see you've already implemented the proxy in C#

@Toxic1594
Yes correct. Though the problem is already fixed in source. Do a compile or wait for a new build to be published in the Releases tab shortly.

@JAEG99 @DidYouTryThis well... did you guys run YgoMaster.exe with admin like it says?

@pixeltris
Copy link
Owner

Closing as duplicate of #387

@yujin12138
Copy link

谢谢你的解释。我看到你已经在 C 中实现了代理#

是的,正确。虽然问题已经在源代码中修复。执行编译或等待新版本很快在“发布”选项卡中发布。

井。。。你们有没有像它说的那样用管理员运行YgoMaster.exe?

I am very sorry to bother you, but when I run cmd.exe according to what you said and run the command you provided, it shows "the system cannot find the specified file". I want to know whether there is something missing or I have done something wrong, thank you very much.

@JAEG99
Copy link
Author

JAEG99 commented May 28, 2024

@macsek1911 I can confirm I did get it to work with the elevated cmd but now that it has also been updated fully it works great for me without this fix so all should be good now. Just remember to run things admin.

@yujin12138 You shouldn't need to use this anymore, just get the new updated release and do the simple LAN or WAN and it works great now.

@yujin12138
Copy link

我可以确认我确实让它与提升的 cmd 一起使用,但现在它也已完全更新,如果没有此修复程序,它对我来说效果很好,所以现在一切都应该很好。只要记住运行事情管理。

您不需要再使用它了,只需获取新的更新版本并执行简单的 LAN 或 WAN,它现在就可以很好地工作了。

But what really bothers me is that my original configuration tool seems to be out of order after the Yu-Gi-King 1.90 update, and I can't perform Intranet penetration to play with distant friends. What I want to know more is how I should set it up so that I can play with distant friends. Thank you very much.

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

No branches or pull requests

7 participants