In resimulation mode, we only copy the buttons. The reason for this
is nonobvious:
If we resimulated nothing, then the /duration/ with which any input
was pressed would be approximately correct, since the original
simulation came in as the input came in, but the /number of times/
the input was pressed would be wrong, as there would be an
advancing wavefront of real data overtaking the simulated data
(which is really just real data offset by some frames).
That's acceptable for arrows in most situations, since the amount
you move is tied to the duration, but unacceptable for buttons,
which will seem to jerkily be pressed numerous times with those
wavefronts.
In the unlikely situation that serial_info wasn't provided and the delta
frame wasn't ready (possibly an impossible situation) it previously
would have segfaulted. This fixes that.
I had previously assumed that if AF_INET6 is defined, IPv6 support was
present. Some psychopathic console SDKs which shall not be named
actually define AF_INET6 but none of the IPv6 structures. As there is
therefore no way to determine whether IPv6 support is present at
preprocessor time, I'm ust assuming that HAVE_SOCKET_LEGACY implies no
IPv6. This means in effect that no consoles get IPv6 support.
Silence some Coverity warnings (including a real memory leak) and be
more careful about checking IPv6 mode (for backwards compatibility with
systems that don't support IPv6 but may run code compiled to expect IPv6)
For the time being, if NAT traversal is successful it simply announces
it as an OSD message. In the future it will be used to inform a
matchmaking server of the public port.
This patch also included minor fixes to the NAT traversal implementation
to make the select it demands actually doable.
As well as the implementation magic, we now send a platform magic in our
connection header. If the core reports platform dependence and the
platform magic differs relevantly, the connection will be refused.
Since netplay_send_info (client handshake) and netplay_get_info (server
handshake) were practically identical, they've also been merged into a
single netplay_handshake.