Code Monkey home page Code Monkey logo

Comments (13)

macsek1911 avatar macsek1911 commented on June 25, 2024 2

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

from ygomaster.

Drake10177 avatar Drake10177 commented on June 25, 2024

same

from ygomaster.

Toxic1594 avatar Toxic1594 commented on June 25, 2024

ye same we have to wait for a fix

from ygomaster.

JAEG99 avatar JAEG99 commented on June 25, 2024

Thank you! I will have to give it ago!

from ygomaster.

DidYouTryThis avatar DidYouTryThis commented on June 25, 2024

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

Any help on this..?

from ygomaster.

JAEG99 avatar JAEG99 commented on June 25, 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

from ygomaster.

pixeltris avatar pixeltris commented on June 25, 2024

@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.

from ygomaster.

Toxic1594 avatar Toxic1594 commented on June 25, 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](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 ?

from ygomaster.

macsek1911 avatar macsek1911 commented on June 25, 2024

@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?

from ygomaster.

pixeltris avatar pixeltris commented on June 25, 2024

Closing as duplicate of #387

from ygomaster.

yujin12138 avatar yujin12138 commented on June 25, 2024

谢谢你的解释。我看到你已经在 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.

from ygomaster.

JAEG99 avatar JAEG99 commented on June 25, 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.

from ygomaster.

yujin12138 avatar yujin12138 commented on June 25, 2024

我可以确认我确实让它与提升的 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.

from ygomaster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.