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/nat_multiplayer] Fix for multiple users behind a NAT #77
Conversation
I'll give this a test too with my OS X and Linux standalones. Am keen to get the multiplayer code improved a tad. |
Unfortunately I don't think I can get standalone running on my VPS due to restricted hard drive space, so I can run one in my basement, but then I only have one computer available outside of the basement to test connecting to that standalone...if you set up a standalone I can get several clients connecting to it from my house behind my NAT probably. |
Hmm, just realized that with a second router I could set up a second NAT in my house for FS2 testing. And I have a router I've been meaning to test anyway. |
I will run this on my home standalone server, if someone could attempt to connect to it with two computers behind the same NAT and see if it works? I think the code only needs to be applied to the standalone side but it couldn't hurt to make sure it's on the clients too. |
Actually since I have two macbooks at work while I transfer my old files to my new one, I might be able to pull off this test myself. But anyone else is welcome to try in case they can beat me to it. |
Verified, that this appears to have fixed this issue. Both my Macbooks on my office NAT were able to connect to my standalone running at home. Still can't join the lobby chat together, but they do both seem to be able to find the games on FS2NetD. The lobby chat should probably remove the IP restriction at some point, but for now this definitely fixes the bug in the standalone. |
I was about to merge this, since chief1983 verified the fix and I reviewed the patch just now. It's perfectly merge-able as-is. However, the psnet_same function is unnecessarily clunky. This version would accomplish the same thing: return !memcmp(a1->addr, a2->addr, 6) && a1->port == a2->port; |
…le users behind a NAT to connect to a remote standalone.
bd42655
to
6e0f9c1
Compare
Updated with the simplified return line. |
Cool cool cool. |
[fix/nat_multiplayer] Fix for multiple users behind a NAT
Vestigare's submitted patch for allowing multiple users behind a NAT to connect to a remote standalone. See http://www.hard-light.net/forums/index.php?topic=88971.0 for more detail. Just putting this out to hopefully get a little more review, I had the patch sitting on my desktop and it's been purged from the thread since, don't want it to disappear forever.