Commit Graph

176 Commits

Author SHA1 Message Date
Gregor Richards
1245d1b5dd Better netplay input simulation
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.
2016-12-18 00:46:02 -05:00
Gregor Richards
8c08a5399d Fix a possible NULL dereference in load_savestate
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.
2016-12-15 16:19:54 -05:00
twinaphex
b4c1927e27 (MSVC 2003) Buildfixes 2006-05-18 13:31:43 +02:00
Gregor Richards
9a4b28735b HAVE_SOCKET_LEGACY -> no IPv6
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.
2016-12-10 05:27:25 -05:00
twinaphex
4bf806ef00 (Netplay) Some build fixes for PS3 and others 2016-12-10 09:41:24 +01:00
Brad Parker
d558862e21 make "Got connection from" translatable. Update JP translation. 2016-12-09 23:38:00 -05:00
Gregor Richards
a70e21f328 Suppress a warning due to weird declarations on Windows. 2016-12-05 20:50:05 -05:00
Gregor Richards
e7f20a3673 Bugfixes
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)
2016-12-05 00:45:40 -05:00
Gregor Richards
2b437ccb8c Don't need to explicitly demand IPPROTO_TCP (and doing so breaks some
SOCKET_LEGACY builds)
2016-12-03 16:33:48 -05:00
Spec-Chum
7a6a0ee7af Fix MSVC compilation 2016-12-03 18:24:49 +00:00
Gregor Richards
f725f38061 Use strlcpy 2016-12-03 09:58:16 -05:00
Gregor Richards
98f0d4d45b Better error messages when the Netplay handshake fails 2016-12-03 09:46:20 -05:00
Gregor Richards
3c7fc73735 sendto fix for MSVC 2016-12-02 23:15:53 -05:00
Twinaphex
d71df5c06f Merge pull request #4138 from GregorR/netplay-port-unsigned-short
Be explicit about types
2016-12-03 05:11:02 +01:00
Gregor Richards
cc664db231 Be explicit about types. 2016-12-02 23:08:34 -05:00
Twinaphex
4b2a45a276 remove unused variables 2016-12-03 05:07:27 +01:00
Gregor Richards
8993003259 C++ fixes 2016-12-02 22:56:37 -05:00
Gregor Richards
0577749fae Netplay LAN scanning is go! (sort of) 2016-12-02 22:40:26 -05:00
Gregor Richards
077d5440ee Allow Netplay to receive a struct netplay_host to connect to rather than
using the configured setting
2016-12-02 21:16:15 -05:00
Gregor Richards
ba0985de37 Actually report the host port as the Netplay port, not the discovery port 2016-12-02 20:38:55 -05:00
Gregor Richards
3446cf09d6 Actually report discovered hosts back to the caller! 2016-12-02 20:28:22 -05:00
Gregor Richards
4c18cec752 Added Netplay discovery code (not yet in menu) 2016-12-02 19:49:42 -05:00
Gregor Richards
addff325d0 Netplay discovery LAN scanning task (incomplete) 2016-12-02 18:56:29 -05:00
Gregor Richards
a082df0027 More stripping out of NAT traversal for SOCKET_LEGACY 2016-12-02 13:18:35 -05:00
Gregor Richards
5739be5594 SOCKET_LEGACY doesn't even necessarily have inet_ntoa, so oh well, no
host for you
2016-12-01 20:40:16 -05:00
Gregor Richards
22798e26c7 delay_frames naming consistency
Unifying all of the various inconsistent names of delay_frames into a
single name: delay_frames.
2016-12-01 13:34:37 -05:00
Gregor Richards
c7f8cd3c68 Adding NAT traversal announcement for SOCKET_LEGACY 2016-11-30 19:01:32 -05:00
Twinaphex
bb499b70be Merge pull request #4104 from GregorR/natt
NAT traversal
2016-11-30 16:09:53 +01:00
Gregor Richards
b3ababce9a Fix Netplay IPv6 support 2016-11-30 00:25:16 -05:00
Gregor Richards
c342c103ae Always get numeric host/ports instead of names. 2016-11-29 23:08:26 -05:00
Gregor Richards
42da0a0184 NAT traversal in Netplay
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.
2016-11-29 22:59:46 -05:00
twinaphex
d26a213971 CXX_BUILD fixes 2016-11-27 13:30:35 +01:00
Gregor Richards
225cbb387b Updating netplay to use trans_stream for compression 2016-11-26 16:06:52 -05:00
Gregor Richards
da0b958aeb Check HAVE_ZLIB and only do zlib compression if it's supported by both
sides.
2016-11-25 11:03:12 -05:00
Gregor Richards
db437047f8 Don't use z_const, which is apparently not always defined. 2016-11-25 10:40:25 -05:00
Gregor Richards
679ea058a4 Properly clean up zlib. 2016-11-25 10:40:24 -05:00
Gregor Richards
3ff22c9ed6 Fixes for C++ support. 2016-11-25 10:40:24 -05:00
Gregor Richards
9f03020af8 Change the netplay protocol version since compression isn't backwards
compatible.
2016-11-25 10:40:24 -05:00
Gregor Richards
53c6223dc6 Use zlib compression for savestates sent over netplay. 2016-11-25 10:40:24 -05:00
Diego Viola
cf0c60bb98 Fix Netplay fullscreen issue
Fixes #3936
2016-11-07 16:01:18 -02:00
Brad Parker
d1d5584d18 update copyright 2016-10-27 11:47:10 -04:00
twinaphex
0d3752e90f More translatable strings 2016-10-22 05:23:59 +02:00
twinaphex
3334060b03 Add another translatable string 2016-10-22 04:49:04 +02:00
twinaphex
9de0ebe859 Make some more strings translatable 2016-10-22 04:47:50 +02:00
twinaphex
42053a82e1 Prevent some implicit memsets 2016-10-21 19:39:51 +02:00
twinaphex
ddb4f85430 netplay_common.c - Buildfix for MSVC 2016-10-19 18:09:59 +02:00
Gregor Richards
2e432b005e Casts for C++ compatibility. 2016-10-10 11:56:43 -04:00
Gregor Richards
5c206c89f0 Add a netplay advertisement server for LAN netplay detection. 2016-10-10 11:52:54 -04:00
Gregor Richards
2c1cd0d06b Netplay should disable when it deinits, so it doesn't auto-reconnect
when loading a new game.
2016-10-09 09:42:06 -04:00
Gregor Richards
6c15c0de3d Support for architecture-dependence serialization quirks in Netplay
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.
2016-10-05 21:12:42 -04:00