Commit Graph

60 Commits

Author SHA1 Message Date
twinaphex
4f931f2729 Use UINT32_C / UINT64_C throughout the codebase 2020-07-29 04:48:11 +02:00
twinaphex
8486c8ebfb Cleanups 2020-06-24 10:54:25 +02:00
twinaphex
737718ba5d (network) Turn functions that are not accessed outside static 2020-05-24 20:38:50 +02:00
twinaphex
3ad4b057f9 Go back to 1.8.4 netcode 2020-05-10 01:02:47 +02:00
twinaphex
9dcc941ec5 Reduce get_time_usec calls 2020-02-29 12:51:42 +01:00
twinaphex
74547c0a81 (netplay) Cleanups 2020-02-27 12:02:55 +01:00
twinaphex
013117318c (network) Get rid of all the settings pointer grabbing 2020-02-12 20:01:48 +01:00
twinaphex
0552c64161 (WiiU) Attempt to fix build 2019-08-11 23:39:26 +02:00
twinaphex
5f2e3c283d (netplay)/network) Style nits/cleanups 2019-06-26 07:13:50 +02:00
orbea
28ff4b391a Clean up white space. 2019-02-03 16:00:50 -08:00
twinaphex
6761ec471d Silence some Coverity warnings 2018-04-12 21:39:31 +02:00
twinaphex
ff9aebedca Some more Clang warning fixes 2018-04-09 17:48:11 +02:00
twinaphex
8e7b1ede7f Silence Clang warnings 2018-04-09 17:35:27 +02:00
Twinaphex
08a54e45f2 Get rid of a lot of implicit conversions 2018-04-09 15:56:45 +02:00
Gregor Richards
a39bff6e03 Remove an incorrect double-check
Netplay sync incorrectly checked whether the replay pointer was behind
the unread pointer twice, when in the second check it should only have
been checking if it was behind the current execution pointer. Because of
how resimulation works with device sharing, I THINK this could affect
sync. Even if it can't, it's wrong.
2018-03-03 23:03:35 -05:00
aliaspider
700fce3bd2 various fixes for CXX_BUILD. 2018-02-04 20:03:27 +01:00
Twinaphex
8bc1d9965d Fix unused variables/etc. 2018-01-23 07:29:04 +01:00
twinaphex
6437e4b4a9 remove tons of unreferenced local variables 2018-01-23 05:49:03 +01:00
Gregor Richards
984f763d75 Only do our careful resimulation with joypads 2018-01-05 14:27:02 -05:00
Gregor Richards
50de28b1a1 Netplay keyboard hack for keydown/keyup support
An unfortunate hack for cores that translate the keyboard input device
into keydown/keyup events without saving that in the savestate. We
simply replay the previous frame's input before loading the rewound
frame's state, to assure that both the state and the keyup/down state
are correct.

Ideally, cores would save this as part of the state, but it's a bit
proximal and a fairly significant change for those that use it, so it's
easier to fix in netplay.
2018-01-05 14:27:02 -05:00
Gregor Richards
a96eb24247 Support for keyboards over netplay. 2018-01-05 14:27:02 -05:00
Gregor Richards
c01a199493 Netplay input device abstraction, support for mice
This abstracts away the details of particular input devices for netplay,
and adds support for mice and (similar) lightguns. Unfortunately, in
practice, no core handles mice or lightguns in a savestate-safe way, so
they need to be used in stateless mode to be reliable, but they do work.
2018-01-05 14:27:02 -05:00
Gregor Richards
6eaaaef995 Minor bugfixes in input resolution. 2018-01-05 14:24:43 -05:00
Gregor Richards
2794031d12 Improved reemulation to not replay unread frames if they haven't changed. 2018-01-05 14:24:43 -05:00
Gregor Richards
74901e6161 Whoops, missed one refactor rename. 2018-01-05 14:24:43 -05:00
Gregor Richards
ed320fd914 Adding and removing players
The new input handling makes adding and removing players more
complicated, since data can be present that's not expected from the
connected clients list, or absent that's expected in the list but
actually shouldn't be there.
2018-01-05 14:24:43 -05:00
Gregor Richards
39243a8d40 Configurable sharing mode. 2018-01-05 14:24:43 -05:00
Gregor Richards
abf045ef0e Made device requests (badly) configurable. 2018-01-05 14:24:43 -05:00
Gregor Richards
fe80c4ce2c Added real pad sharing modes. 2018-01-05 14:24:43 -05:00
Gregor Richards
e4029b72c1 Rename things back after renaming for refactoring. 2018-01-05 14:24:42 -05:00
Gregor Richards
b897ba4e30 Re-fixed input simulation. 2018-01-05 14:24:42 -05:00
Gregor Richards
8c551f3990 Fixing some counters. 2018-01-05 14:24:42 -05:00
Gregor Richards
ed69916e59 First cut of input changes (not yet working) 2018-01-05 14:24:42 -05:00
Gregor Richards
6d4119690d First step (not yet compiling) of changing around Netplay input. 2018-01-05 14:24:42 -05:00
Gregor Richards
fb3c35dc9f Handle forwarding of netplay state demotions correctly.
Netplay state demotions, i.e. changes from playing to spectating or
disconnected states, could cause chain disconnections of all other
clients. This was due to a bug in when MODE change messages were sent.
Clients rely on the server sending all messages in its own order, and as
a consequence, the server typically holds messages for retransmission
until they can be retransmitted at the correct time. MODE messages were
not held, so could be sent early. When they were sent early, this caused
other clients to panic and disconnect.

A smaller but much stupider secondary bug was also fixed, in which the
first connection could be dropped due simply to writing connections[0]
instead of connections[i] somewhere.
2017-06-06 21:35:09 -04:00
Gregor Richards
fbb508ab5e Make rewind compatible with netplay.
This commit adds support for temporary desync in netplay. When frontend
features that can't be truly synced, in particular rewind, are used,
netplay is momentarily disabled. As soon as the feature finished, e.g. a
rewind ending, netplay resumes with a state load. For rewind, netplay
peers won't actually experience the effect of rewind, but they will load
the rewound state.
2017-04-18 15:25:58 -04:00
Gregor Richards
3ff9a43b7d Spectator and slave mode are rewind-free
This commit makes spectator mode and slave mode in netplay always stay
ahead of the input, thereby avoiding rewinds, which is sort of the
point. This also changes catch-up detection to be a bit less eager, so
that they hopefully don't flap between stalling for server input and
catching up with that input.
2017-02-23 19:05:43 -05:00
Gregor Richards
d1ab288d73 Fix update_unread_ptr to handle the case of only slaves connected 2017-02-22 21:10:02 -05:00
Gregor Richards
e70ee045bf Initial implementation of Netplay master/slave mode. 2017-02-22 20:34:17 -05:00
Gregor Richards
4c1abfaa71 Support for reset in netplay
This patch transfers core_reset across netplay. Resets effectively
worked before thanks to check_frames, but this makes resets work even
without check_frames, and in particular should allow resets to force
sync in savestateless cores, bringing them one step closer to actually
being usable by non-experts.
2017-02-15 14:40:37 -05:00
Gregor Richards
2ea3936d16 Renaming input_ptr/input_frame_count back to self_. 2017-02-01 22:54:03 -05:00
Gregor Richards
55157e934d input_latency_frames is now configurable and has a range 2017-02-01 22:54:03 -05:00
Gregor Richards
c4cb94db19 New approach to input latency 2017-02-01 22:54:03 -05:00
twinaphex
96c8ca5a09 Header update #1 2017-01-22 13:40:32 +01:00
twinaphex
768ce0854c Make driver_set_nonblock_state a public function 2017-01-22 12:47:17 +01:00
Gregor Richards
cd281d5757 Reverse catch-up, i.e., server-demanded stalling
Previously, if two clients were connected to the same server and one of
them was ahead of the server, the only way to rectify that situation was
for the client to get so far ahead that it stalled, as the server could
only catch up with an ahead client if all clients were ahead. That's
unrealistic. This gives the server the alternate option of demanding
that a client stall. This keeps things nicely in line even with >2
players.
2016-12-24 15:25:03 -05:00
twinaphex
70a1a5f38e Buildfixes 2016-12-24 01:48:36 +01:00
twinaphex
64dc7daeca (MSVC) MSVC build fixes 2016-12-24 01:45:37 +01:00
Gregor Richards
dcd4b3046b Making negative check_frames be "check only" mode 2016-12-18 19:28:44 -05:00
Gregor Richards
84c33634a6 Communicate paused-ness during initial connection SYNC. 2016-12-18 19:28:44 -05:00