1
0
mirror of https://github.com/libretro/RetroArch synced 2025-03-03 04:14:00 +00:00

112 Commits

Author SHA1 Message Date
libretroadmin
38bc51f5c2 (config.def.h) only try to include define headers 2022-11-27 22:57:17 +01:00
LibretroAdmin
db6e0b1f42 Removed credits - requested by author 2022-11-01 21:40:13 +01:00
LibretroAdmin
9a3a5688b8 Go about this a better way - the conditionals should now be fixed 2022-10-31 20:23:57 +01:00
LibretroAdmin
cb1b02a1c3 Revert changes to struct - concern trolling over perceived
backwards compat. regression (whether proven or not)
2022-10-31 19:17:05 +01:00
LibretroAdmin
11047c6f4d (netplay_frontend) Use flags instead of booleans 2022-10-30 18:20:08 +01:00
Cthulhu-throwaway
daf8cb9bc8
(Netplay) Add a private or CGNAT address warning to UPnP () 2022-10-03 01:18:34 +02:00
Cthulhu-throwaway
908667d97a
(Netplay) Removal of older unused code () 2022-08-11 23:17:33 +02:00
Cthulhu-throwaway
c030e1c5dc
(Netplay) Support for customizing chat colors () 2022-08-08 20:09:06 +02:00
Cthulhu-throwaway
8105688a99
(Netplay) Show client slowdown information () 2022-08-02 13:31:55 +02:00
Cthulhu-throwaway
cc7c310aa1
(Netplay) Refactor fork arguments () 2022-07-24 04:26:50 +02:00
Cthulhu-throwaway
eb36c35ebf
(Netplay) Fix content reload deadlocks on static core platforms () 2022-07-23 03:08:26 +02:00
libretroadmin
e4b33fd0e6 (formats/json/rjson.c) Get rid of some implicit strlens and pass
size parameter to the functions instead˜
2022-07-17 06:58:22 +02:00
Cthulhu-throwaway
c6e0e7e198
(Netplay) Support for banning clients () 2022-07-07 13:40:38 +02:00
Cthulhu-throwaway
b55fa28896
(Netplay/Menu) Localize relay servers () 2022-07-03 13:45:13 +02:00
Cthulhu-throwaway
42f75e7f72
(Netplay/Menu) Add client devices info to the kick sub-menu () 2022-07-03 13:44:46 +02:00
Cthulhu-throwaway
58fc77850c
(Netplay/Lobby) Hide older (incompatible) rooms () 2022-07-01 01:01:24 +02:00
Cthulhu-throwaway
a7dc57f68f
(Network) Move the addr_6to4 function to a proper place () 2022-06-25 09:18:32 +02:00
Cthulhu-throwaway
7e798d04ba (Netplay) Some refactoring and fixes 2022-06-17 18:00:48 -03:00
Cthulhu-throwaway
43ad2b64b2 (Network) Replace socket_select calls 2022-06-12 02:13:34 -03:00
Cthulhu-throwaway
bcc31be6da (Netplay/LAN Discovery) Support for IPv4 tunneling (6to4) 2022-06-01 06:34:43 -03:00
Cthulhu-throwaway
17b7b1322e (Netplay) Some cleaning 2022-05-30 22:02:24 -03:00
Cthulhu-throwaway
e4f8b531d5 (Netplay) Some refactoring and cleaning 2022-05-27 17:21:34 -03:00
Cthulhu-throwaway
f0baf977fa (Network) Move natt files to "network" 2022-05-18 23:23:40 -03:00
Cthulhu-throwaway
82c9773e0d (Netplay) Chat supported info for the host kick submenu 2022-05-15 19:38:44 -03:00
Cthulhu-throwaway
6d96df0e49 (Netplay) Support for gathering client info and kicking
Client info and kicking (by the host) is now implemented through netplay_driver_ctl and can be used by future features.
2022-05-13 22:42:08 -03:00
Cthulhu-throwaway
7c3dfa5e3a
(Netplay/LAN Discovery) Ensure fixed width ints on packet struct () 2022-04-29 20:26:34 +02:00
Cthulhu-throwaway
26132a2330
Netplay and NAT struct improvements ()
Reordered netplay and NAT structs to follow the coding guidelines more closely.

Moved part of the chat struct out of the program's image and into the heap.
2021-12-25 13:42:22 +01:00
Cthulhu-throwaway
c752f9b0de
Custom relay server support ()
* Custom relay server support

Add support for custom user-ran relay servers.

* snprintf NULL fix
2021-12-23 13:54:52 +01:00
Cthulhu-throwaway
b9041995f0
Add asian relay server ()
Replace the canadian server with an asian one.
2021-12-22 16:33:41 +01:00
Jamiras
3d84a9960e
(cheevos) check netplay status when unlocking achievements ()
* check netplay status when unlocking achievements instead of permanently disabling them in spectate mode

* fix c89 build

* add RARCH_NETPLAY_CTL_IS_SPECTATING
2021-12-21 15:58:42 +01:00
Cthulhu-throwaway
966335e367
Smaller Netplay Changes ()
Lobby Viewer: Filter out rooms that are not running RetroArch
Lobby Viewer: Display a non-connectable tag to non-connectable rooms.
Host: Display warning if we are announcing to the internet but our room isn't connectable from there.
2021-12-21 15:58:25 +01:00
Cthulhu-throwaway
690c802921
Netplay Stuff ()
* 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
Autechre
3b1a1ac8da
Remove miniupnpc dependency ()
* use custom libretro-common UPNP

* Remove miniupnpc
2021-12-09 05:52:42 +01:00
twinaphex
a6ed23d031 Revert "(cthulhu88) Add netplay chat command"
This reverts commit 6a490c03832a2d48607a99b17309faa46db0fa80.
2021-11-12 19:01:31 +01:00
twinaphex
efa16a8fca Revert "(Netplay) Cthulhu88 -"
This reverts commit cb4028fd3d770241100708c8fea66782cfa6b4de.
2021-11-12 19:00:42 +01:00
twinaphex
d7a8bc55a3 Revert "(Cthulhu88) Add netplay hotkey bind"
This reverts commit deaf116d38904f80bbcfa18f56bcf7f6560c6aa3.
2021-11-12 19:00:24 +01:00
twinaphex
62a8b13b1a Revert "(Cthulhu88) Netplay - initial netplay tunnel"
This reverts commit 369cafe1ad488eaec304fb12bc395ea7e34ca96d.
2021-11-12 18:59:52 +01:00
twinaphex
753332ff18 Revert "(Cthulhu88) Fix for multi-char arrays"
This reverts commit e64cd247150de4cadaab62a574d219eef3fdbd84.
2021-11-12 18:59:35 +01:00
twinaphex
70ee3fbca7 Revert "(Cthulhu88) New Netplay MITM Part 2"
This reverts commit 34c374737c1c09497bf28af090a045656ac07bde.
2021-11-12 18:58:40 +01:00
twinaphex
34c374737c (Cthulhu88) New Netplay MITM Part 2 2021-11-12 06:31:54 +01:00
twinaphex
e64cd24715 (Cthulhu88) Fix for multi-char arrays 2021-11-11 05:38:45 +01:00
twinaphex
369cafe1ad (Cthulhu88) Netplay - initial netplay tunnel 2021-11-11 04:55:37 +01:00
twinaphex
deaf116d38 (Cthulhu88) Add netplay hotkey bind 2021-11-10 04:58:59 +01:00
twinaphex
cb4028fd3d (Netplay) Cthulhu88 -
* Netplay Chat menu
* Toggleable bind for chat (bound to ~ [tilde] by default)
2021-11-10 02:41:02 +01:00
twinaphex
6a490c0383 (cthulhu88) Add netplay chat command 2021-11-09 02:52:04 +01:00
twinaphex
0af9b72388 (network) Cleanups 2021-11-06 00:27:51 +01:00
twinaphex
a50cd1105e Hopefully fixes it 2021-11-05 19:18:26 +01:00
twinaphex
67c010394d Remove netplay_discovery.h - hopefully fixes other build issues 2021-11-05 19:12:55 +01:00
twinaphex
aadedf39f2 Buildfixes as suggested by forum member - should hopefully fix
console builds as well as other issues
2021-11-05 19:04:52 +01:00
twinaphex
3bc6dd97d9 Revert "Revert "Move stray globals to networking state""
This reverts commit a796f1ce58975a640e6b843067645db304b503f7.
2021-11-05 18:55:55 +01:00