Commit Graph

897 Commits

Author SHA1 Message Date
Jamiras
7ad71a4a05
fix memory map conversion (#13386) 2021-12-21 21:15:03 +01:00
Nikos Chantziaras
0357b6c922
Add on-screen statistics toggle hotkey (#13381)
* Add on-screen statistics toggle hotkey

* CHANGES.md: Add technical statistics hotkey
2021-12-21 00:03:35 +01:00
Cthulhu-throwaway
690c802921
Netplay Stuff (#13375)
* Netplay Stuff

## PROTOCOL FALLBACK
In order to support older clients a protocol fallback system was introduced.
The host will no longer send its header automatically after a TCP connection is established, instead, it awaits for the client to send his before determining which protocol this connection is going to operate on.
Netplay has now two protocols, a low protocol and a high protocol; the low protocol is the minimum protocol it supports, while the high protocol is the highest protocol it can operate on.
To fully support older clients, a hack was necessary: sending the high protocol in the unused client's header salt field, while keeping the protocol field to the low protocol. Without this hack we would only be able to support older clients if a newer client was the host.
Any future system can make use of this system by checking connection->netplay_protocol, which is available for both the client and host.

## NETPLAY CHAT
Starting with protocol 6, netplay chat is available through the new NETPLAY_CMD_PLAYER_CHAT command.
Limitations of the command code, which causes a disconnection on unknown commands, makes this system not possible on protocol 5.
Protocol 5 connections can neither send nor receive chat, but other netplay operations are unaffected.
Clients send chat as a string to the server, and it's the server's sole responsability to relay chat messages.
As of now, sending chat uses RetroArch's input menu, while the display of on-screen chat uses a widget overlay and RetroArch's notifications as a fallback.
If a new overlay and/or input system is desired, no backwards compatibility changes need to be made.
Only clients in playing mode (as opposed to spectating mode) can send and receive chat.

## SETTINGS SHARING
Some settings are better used when both host and clients share the same configuration.
As of protocol 6, the following settings will be shared from host to clients (without altering a client's configuration file): input latency frames and allow pausing.

## NETPLAY TUNNEL/MITM
With the current MITM system being defunct (at least as of 1.9.X), a new system was in order to solve most if not all of the problems with the current system.
This new system uses a tunneling approach, which is similar to most VPN and tunneling services around.

Tunnel commands:
RATS[unique id] (RetroArch Tunnel Session) - 16 bytes -> When this command is sent with a zeroed unique id, the tunnel server interprets this as a netplay host wanting to create a new session, in this case, the same command is returned to the host, but now with its unique session id. When a client needs to connect to a host, this command is sent with the unique session id of the host, causing the tunnel server to send a RATL command to the host.
RATL[unique id] (RetroArch Tunnel Link) - 16 bytes -> The tunnel server sends this command to the host when a client wants to connect to the host. Once the host receives this command, it establishes a new connection to the tunnel server, sending this command together with the client's unique id through this new connection, causing the tunnel server to link this connection to the connection of the client.
RATP (RetroArch Tunnel Ping) - 4 bytes -> The tunnel server sends this command to verify that the host, whom the session belongs to, is still around. The host replies with the same command. A session is closed if the tunnel server can not verify that the host is alive.

Operations:
Host -> Instead of listening and accepting connections, it connects to the tunnel server, requests a new session and then monitor this connection for new linking requests. Once a request is received, it establishes a new connection to the tunnel server for linking with a client. The tunnel server's address and port are obtained by querying the lobby server. The host will publish its session id together with the rest of its info to the lobby server.
Client -> It connects to the tunnel server and then sends the session id of the host it wants to connect to. A host's session id is obtained from the json data sent by the lobby server.

Improvements (from current MITM system):
No longer a risk of TCP port exhaustion; we only use one port now at the tunnel server.
Very little cpu usage. About 95% net I/O bound now.
Future backwards compatible with any and all changes to netplay as it no longer runs any netplay logic at MITM servers.
No longer operates the host in client mode, which was a source of many of the current problems.
Cleaner and more maintainable system and code.

Notable functions:
netplay_mitm_query -> Grabs the tunnel's address and port from the lobby server.
init_tcp_socket -> Handles the creation and operation mode of the TCP socket based on whether it's host, host+MITM or client.
handle_mitm_connection -> Creates and completes linking connections and replies to ping commands (only 1 of each per call to not affect performance).

## MISC
Ping Limiter: If a client's estimated latency to the server is higher than this value, connection will be dropped just before finishing the netplay handshake.
Ping Counter: A ping counter (similar to the FPS one) can be shown in the bottom right corner of the screen, if you are connected to a host.
LAN Discovery: Refactored and moved to its own "Refresh Netplay LAN List" button.

## FIXES
Many minor fixes to the current netplay implementation are also included.

* Remove NETPLAY_TEST_BUILD
2021-12-19 16:58:01 +01:00
Tony
8cc423e036
Logging cleanups (#13370) 2021-12-17 18:04:24 +01:00
Tilman M. Jaeschke
682bbab233
[New Feature] Load save states from command-line or playlist (#13354)
* load save states from command-line or playlist

* load save states from command-line or playlist

* removed some brackets
2021-12-14 14:08:06 +01:00
Tony
09880e92d2
Logging cleanups (#13320) 2021-12-04 14:21:12 +01:00
Tony
41838ef544
Refresh rate switch addition on startup (#13316) 2021-12-03 17:52:46 +01:00
Tony
121ca3a482
'Automatic Frame Delay' improvements: (#13297)
- swap interval handling
- d3dx handling
2021-12-02 02:32:39 +01:00
Autechre
5bb4df3a42
Move translation task code to tasks/task_translation.c (#13274) 2021-11-22 15:19:20 +01:00
twinaphex
9982452c18 Move code from retroarch.c to runloop.c 2021-11-22 03:33:58 +01:00
Autechre
2b87cd9313
Create runloop.c and split up runloop code to this new file; (#13269)
* Create runloop.c and split up runloop code to this new file;
retroarch.c now 207Kb and runloop.c 301Kb

* Define empty runloop_secondary_core_destroy
2021-11-22 03:27:23 +01:00
twinaphex
0a5d4288f5 Rollback runloop changes - will require a rethink in how we approach
this
2021-05-25 20:41:39 +02:00
twinaphex
2b4f2525d0 move more runloop functions over to runloop.c 2021-05-24 02:57:40 +02:00
twinaphex
75175ddbce move more runloop functiosn to runloop.c 2021-05-24 02:27:55 +02:00
twinaphex
b48ab663b0 Move BSV runloop code over to runloop.c 2021-05-23 02:20:01 +02:00
twinaphex
d1c7d97b10 Split up code to runloop.c 2021-05-22 23:09:00 +02:00
twinaphex
42ebe7a7ad Merge runloop.c and retroarch.c 2017-05-11 09:11:46 +02:00
twinaphex
2906bec7a8 Create input_driver_get_uint 2017-05-11 07:36:21 +02:00
twinaphex
5e7f175545 Remove some obsolete RUNLOOP_CTL_ actions 2017-05-08 04:41:24 +02:00
twinaphex
9605c01c49 Rename command_event_quit to retroarch_main_quit 2017-05-08 03:54:51 +02:00
twinaphex
0815055906 Pressing hotkey should invoke same operation as manually selecting
'Quit' from the menu - should hopefully fix issues with flushing
SRAM to disk/saving autostate
2017-05-08 03:41:23 +02:00
Twinaphex
12027bf1a8 Merge pull request #4889 from leiradel/master
Reverted cheevos changes in preparation for conversion to task; fixed 4884
2017-05-07 20:28:32 +02:00
Andre Leiradella
844d1475e6 Reverted cheevos changes in preparation for conversion to task; fixed 4884 2017-05-07 19:06:03 +01:00
twinaphex
f97d084290 Create camera_driver_poll 2017-05-07 19:24:03 +02:00
twinaphex
a2fe3dcaaf Revert "Refactor BSV movie code"
This reverts commit 7dca09d6f8.
2017-05-07 18:28:07 +02:00
twinaphex
7dca09d6f8 Refactor BSV movie code 2017-05-07 18:21:58 +02:00
twinaphex
ce8083fd2e Create runloop_{set|unset} - only do autosave lock/unlock if
autosaves are actually active
2017-05-07 18:05:37 +02:00
twinaphex
d349ea61cf Create bsv_movie_end_of_file 2017-05-06 18:11:18 +02:00
twinaphex
d9c5013d42 Pass settings struct around 2017-05-06 06:46:48 +02:00
twinaphex
33f2fe8029 Move cheevos.c to tasks/task_cheevos.c and add TODO/FIXME note 2017-05-06 05:50:46 +02:00
twinaphex
e6ab06a701 Move path variables 2017-04-29 00:39:29 +02:00
twinaphex
05e4ec733e Move uint variables 2017-04-28 21:03:04 +02:00
twinaphex
7bbd20b31d Move int settings 2017-04-28 19:12:48 +02:00
twinaphex
0da40fb3aa Move all float settings 2017-04-28 14:57:55 +02:00
twinaphex
ed53be7c81 Move all bool settings 2017-04-28 14:11:34 +02:00
twinaphex
cc095e56fc Start refactoring bool variables 2017-04-28 00:53:20 +02:00
twinaphex
3087ceb482 Don't go through all these slow wrapper functions 2017-04-25 20:47:21 +02:00
twinaphex
d66aff8fbd Start wrapping settings->input.binds 2017-04-25 18:12:13 +02:00
twinaphex
6ace8ce66a Rewrite autoconf_binds and move it to task_autodetect.c - take
it out of the settings struct
2017-04-25 16:33:30 +02:00
twinaphex
13e4148996 (Menu) Cleanups 2017-04-23 20:22:41 +02:00
twinaphex
3ec5816259 Rewrite RUNLOOP_CTL_SYSTEM_INFO_GET 2017-04-23 16:41:26 +02:00
twinaphex
1febb963ae Start bookkeeping when we are modifying settings 2017-04-23 13:24:17 +02:00
twinaphex
1cc350bfdb Prevent some implicit memsets 2017-04-20 09:21:08 +02:00
twinaphex
592fe4d967 Too long filenames were causing crashes/segfaults 2017-04-15 02:38:22 +02:00
twinaphex
8c89ec158c Update copyrights 2017-03-22 03:09:18 +01:00
Twinaphex
b7b3b2cb5f Try to prevent truckload of warnings on iOS 2017-02-26 10:33:03 +01:00
twinaphex
d0e49a2d8f Rename some tasks 2017-02-21 16:50:39 +01:00
twinaphex
ba16bee5d1 Create task_push_content_load_nothing_with_dummy_core 2017-02-21 03:32:52 +01:00
twinaphex
e3a1b1859d Fix ./configure --disable-rgui 2017-02-04 09:20:41 +01:00
Andre Leiradella
0c8ee93e3e Moved cheevos files to their own folder in preparation for the changes to support leaderboards 2017-02-03 10:03:57 +00:00