Hi, I’ve been banging my head against the unity networking code, and I was hoping that one of the developers might be able to sound off on this. Please bear with me if it rambles.
Currently we’re running connection testing, and for just about everyone behind a router it’s reporting that NAT punch through is working. However, when it comes time to start a game, it doesn’t work.
It appears that the connection tester reports PrivateIPHasNATPunchThrough even if the client has a symmetric NAT scheme. If it’s known that unity cannot navigate certain NAT schemes, why doesn’t the tester identify those situations? If it does, and I’m doing something wrong, how should I be testing the connection to see if the machine I’m on can host?
The master server reports the port that it received communications from the registering server, correct? So if I start a server at X, and the router talks to the master server on port Y, then when client C gets the server list, the HostData structure will contain port Y, correct?
If the above is true, then a player with a symmetric router can still host if he forwards port X to his machine, but then the client has to know to connect on port X directly, and not the port sent by the master server.
If the client can detect that its punch through won’t work, then it could at least notify the master server, and the client can either connect to a known port, or the master server can send the correct port via the comments field.
Because our game is designed to be both peer-to-peer, and a facebook app, it has to automagically work pretty much all the time. We can certainly add proxy message routing support to our game using the provided API, but at the end of the day without robust connection testing, we have no way of knowing which way the client should connect to the server.
This is an area of unity where the documentation and support seem below average, and I would love to talk to someone about this in greater detail. At the moment it’s hard to tell if I’m doing something wrong, if there are bugs or missing functionality in the engine, if it’s just bad documentation, or if I’m simply asking too much.
Thanks for your time, I really hope someone can shed some light on this.