-
Notifications
You must be signed in to change notification settings - Fork 67
Allow multiple instances to run and connect to each other for debugging #407
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
base: main
Are you sure you want to change the base?
Conversation
@helmutbuhler Did you explore changing the port of clients instead of the ip? |
I initially wanted to do it with different ports, but there are several issues:
But I also don't understand what the problem with this PR is. I put quite some effort into it to make it work and for the diff to be so small. The only downside I see is that it cannot be used to connect with the retail client locally. But I think that's just impossible to implement. |
I can confirm the observation that using ports would involve much more code changes. What are the estimated disadvantages of broadcasting all messages to all players during matches? I suspect traffic will be quite a bit larger since every client receives all packages? |
Just a thought in case it helps, afaiu localhost is not just 127.0.0.1 but actually |
Yeah, broadcasting will scale terribly. P2P already scales n^2 with the number of peers, this broadcasting worsens it to n^3. So far I have tested this PR only with up to 3 peers, I don't know with how many peers it will still work. |
Hm, that sounds too good to be true :) But I havn't checked, it might work. |
Oh this looks promising !! https://en.wikipedia.org/wiki/Localhost
|
This adds a define ENABLE_FAKE_IP which can be used to build in a way that allows multiple instances to run on the same computer and connect to each other, as if the instances connect in a LAN.
Note that this PR only changes the code when the #define is set. So it doesn't actually change anything for the final build. But if the goal for the first patch is to fix network bugs, I believe this could help other developers to tackle those.
See also the following description: