Commit Graph

90 Commits

Author SHA1 Message Date
gblues 6904101c44 Clean up trailing whitespace
== DETAILS

Really simple code cleanup, because my editor flags trailing whitespaces
and it's pretty annoying.
2017-12-12 00:24:18 -08: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 2681352d53 Make sure we flush a netplay pause message, so it isn't forgotten. 2017-05-22 16:27:22 -04:00
radius 1de95c6413 further refinement of the netplay workflow 2017-05-16 00:18:29 -05:00
twinaphex 42ebe7a7ad Merge runloop.c and retroarch.c 2017-05-11 09:11:46 +02:00
twinaphex ed53be7c81 Move all bool settings 2017-04-28 14:11:34 +02:00
Brad Parker 96650e14ea break early if server frame count is ahead of NOINPUT 2017-02-28 21:46:57 -05:00
Twinaphex fdbdcfee65 Merge pull request #4691 from GregorR/netplay-slave-mode
Netplay slave mode
2017-02-26 21:49:21 +01:00
Twinaphex b7b3b2cb5f Try to prevent truckload of warnings on iOS 2017-02-26 10:33:03 +01:00
Gregor Richards 07cfd90dc6 Actually USE the new slave options in config. 2017-02-23 21:49:22 -05: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 e70ee045bf Initial implementation of Netplay master/slave mode. 2017-02-22 20:34:17 -05:00
Gregor Richards 972b41f803 Fix race condition in NAT traversal task. 2017-02-20 20:16:53 -05:00
Gregor Richards 5f723d1bda Moving NAT traversal into a task to avoid blocking the UI. 2017-02-20 19:08:31 -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 1148b8230c Fixes to stateless+input latency. 2017-02-01 22:54:03 -05:00
Gregor Richards 2ea3936d16 Renaming input_ptr/input_frame_count back to self_. 2017-02-01 22:54:03 -05:00
Gregor Richards 5f5a8dc6d7 CRC searching should really start from run_ptr, not input_ptr 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
Gregor Richards ee55e2d783 LOAD_SAVESTATE can't use player frame timing from a server that's not playing 2017-01-02 18:56:08 -05: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 77e5cdbfde Revert "Rename runloop_msg_queue_push to video_driver_msg_queue_push"
This reverts commit ad7386913c.
2016-12-22 23:36:11 +01:00
twinaphex ad7386913c Rename runloop_msg_queue_push to video_driver_msg_queue_push
and move code to video_driver.c
2016-12-22 13:15:02 +01:00
Twinaphex 1d36c5effa Silence warnings - remove unused variables 2016-12-19 23:19:59 +01:00
Gregor Richards 677ffa9ebd Support different forms of compression from different clients. 2016-12-18 19:28:44 -05:00
Gregor Richards e79f30604f Better stall timing
We now stall not until we've reached parity (which makes no sense since
we expect latency), but only until we're not likely to stall again.
2016-12-18 19:28:44 -05:00
Gregor Richards 7c2f12fbd9 Removign some leftover debug code 2016-12-18 19:28:44 -05:00
Gregor Richards 04266cf4f7 Run synchronization even when stalled
Previously, we could be stalled by one player but still reading data
from another, which would wedge the client because we would never act
upon the newly-read data. Now we act upon data even if we're stalled.
Fixes bugs in initial connection with high latency.
2016-12-18 19:28:44 -05:00
Gregor Richards d6d96704fd Don't panic about delta frames not being ready if we're not even fully
connected yet.
2016-12-18 19:28:43 -05:00
Gregor Richards 8b21014d07 Improvements to handshake protocol
Making the netplay handshake protocol send the core and content as an
explicit command, so that the other side can (notionally) choose to load
it. That isn't implemented, of course.
2016-12-18 19:28:43 -05:00
Gregor Richards 1fa60b396f Improvements to the communication of netplay pausing. 2016-12-18 19:28:43 -05:00
Gregor Richards 6890456ac0 Updated error messages and fixed some stall-related disconnected-client
bugs.
2016-12-18 19:28:43 -05:00
Gregor Richards df2600fbf4 Added error reporting when a player is not allowed to play. 2016-12-18 19:28:43 -05:00
Gregor Richards 4e01481b39 Only allow clients to load state if there's no further synchronization 2016-12-18 19:28:43 -05:00
Gregor Richards da7efcb939 Cleaning up netplay headers. 2016-12-18 19:28:43 -05:00
Gregor Richards 03415c261d Added netplay spectator password separate from play password 2016-12-18 19:28:43 -05:00
Gregor Richards 694b7a9723 Don't allow more players to join than are actually being polled 2016-12-18 19:28:43 -05:00
Gregor Richards 1b22191869 Deduplicating some code. 2016-12-18 19:28:43 -05:00
Gregor Richards 7e2465ef1f Refactoring: Moving I/O functionality into netplay_io.c 2016-12-18 19:28:43 -05:00