59953 Commits

Author SHA1 Message Date
Cthulhu-throwaway
9e208198f2
Endianness fix for netplay_is_lan_address (#13413) 2021-12-25 04:07:55 +01:00
Cthulhu-throwaway
98bed89d6f
Netplay custom relay server to use default port (#13411)
Allow the custom server to use the default port if a port was not provided.
2021-12-25 02:30:33 +01:00
github-actions
d056a989ee Fetch translations from Crowdin 2021-12-25 00:06:59 +00:00
twinaphex
33cc889f7f (HDR) Hide HDR settings unless HDR is enabled 2021-12-24 21:15:08 +01:00
Cthulhu-throwaway
6a100272a8
Netplay spectator notification fix (#13409)
Fix double notification when the host switches to spectator.
2021-12-24 16:42:16 +01:00
twinaphex
689057a9b2 Fix iOS/CocoaTouch builds 2021-12-24 15:42:00 +01:00
Cthulhu-throwaway
736ab4c964
MSVC 2005 build fix (#13408) 2021-12-24 14:58:18 +01:00
tunip3
a28e226ef4
Make resolution switching automatic and fix angle output issues [UWP/XBOX] (#13406)
* force angle to render at 1080p regardless of screensize as the output is 1080p regardless of screensize.
This fixes an issue where at 4k any angle output would be zoomed into a corner

* set resolution based on display resolution (auto 4k)

* set driver to d3d11 if booting with opengl

* reset width and height of output on boot to match display

Co-authored-by: Tunip3 <tunip3@users.noreply.github.com>
2021-12-24 14:34:30 +01:00
twinaphex
e1d144e2b8 (Wayland) Style nits 2021-12-24 14:29:12 +01:00
Colin Kinloch
f0392474f2
(Wayland) Add libdecor for client side decoration (#13397) 2021-12-24 14:20:45 +01:00
Cthulhu-throwaway
b67b93ebfe
Enable GetBestRoute for MSVC 2005 (#13407) 2021-12-24 14:15:20 +01:00
twinaphex
43d0fa6248 remove unused variable 2021-12-24 12:51:23 +01:00
Cthulhu-throwaway
b696903162
UPnP fix for another specific router (#13404)
* UPnP fix for another specific router

Fix UPnP for a specific router device.

Also fix net_http not writing the host's port within the HTTP request.

* Quick edit
2021-12-24 11:56:51 +01:00
twinaphex
393e42a497 (Wayland) Buildfix 2021-12-24 05:25:30 +01:00
Colin Kinloch
c48d533950
(Wayland) Add scroll wheel support (#13398) 2021-12-24 03:42:33 +01:00
Colin Kinloch
1afbe4a326
(Wayland) Use checked sizes in EGL resize (#13394) 2021-12-24 03:27:07 +01:00
Colin Kinloch
7d52d43667
[Wayland] Fix window title update (#13396) 2021-12-24 03:14:20 +01:00
github-actions
c0ed1e3367 Fetch translations from Crowdin 2021-12-24 00:07:38 +00:00
Cthulhu-throwaway
ec97c86756
Attempt to fix UPnP for some Windows devices (#13402)
Yet another attempt at it.
2021-12-23 23:52:01 +01:00
Cthulhu-throwaway
c6369b7861
MSVC 2005 Build Fix (#13401) 2021-12-23 22:08:13 +01:00
Cthulhu-throwaway
c4049b9597
NAT and netplay Fixes (#13400)
* NAT and netplay Fixes

Fix a crash when announcing your room to the internet without being in a tunnel.

Fix improper interface for UPnP for some Windows devices.

* Final edits
2021-12-23 21:28:30 +01:00
Jamiras
e0ad9f7e26
fix netplay UPNP binding for specific router behavior (#13399)
* fix netplay UPNP binding for specific router behavior

* use ISSPACE macro
2021-12-23 19:30:35 +01:00
Cthulhu-throwaway
c752f9b0de
Custom relay server support (#13395)
* Custom relay server support

Add support for custom user-ran relay servers.

* snprintf NULL fix
2021-12-23 13:54:52 +01:00
github-actions
f6291adf01 Fetch translations from Crowdin 2021-12-23 00:07:28 +00:00
Cthulhu-throwaway
b9041995f0
Add asian relay server (#13393)
Replace the canadian server with an asian one.
2021-12-22 16:33:41 +01:00
tunip3
fb6bf6023a
Move roms copied to localstate to a dedicated dir and clear on start up [XBOX/UWP] (#13392)
* make roms copy to a specific cache dir in the localstate folder when its copied

* auto delete vfs cache dir on start up

Co-authored-by: Tunip3 <tunip3@users.noreply.github.com>
2021-12-22 12:55:33 +01:00
Cthulhu-throwaway
eff6f41a38
Netplay protocol macro (#13391)
Wrap protocol checks inside of a guard macro.
2021-12-22 03:05:35 +01:00
MajorPainTheCactus
9151326b73
Added support for HDR shaders - if we detect a shader that uses SLANG_FORMAT_A2B10G10R10_UNORM_PACK32 or SLANG_FORMAT_R16G16B16A16_SFLOAT as the format for the last render target in the shader chain AND hdr is switched on then this disables the internal HDR shader and allows the shader chain to define an inverse tonemapper and hdr10 shader. The first use of this is for my hdr shader crt\crt-sony-pvm-4k-hdr.slangp - submitted seperately (#13390) 2021-12-22 02:17:17 +01:00
github-actions
b21f3964b6 Fetch translations from Crowdin 2021-12-22 00:07:46 +00:00
Tony
9da43ad34e
(RGUI) Add Finnish to supported languages (#13389) 2021-12-21 21:15:26 +01:00
Jamiras
7ad71a4a05
fix memory map conversion (#13386) 2021-12-21 21:15:03 +01:00
twinaphex
07534e4a6d Fix relative path includes 2021-12-21 19:56:00 +01:00
Jamiras
3d84a9960e
(cheevos) check netplay status when unlocking achievements (#13379)
* 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 (#13387)
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
github-actions
3f7d279acf Fetch translations from Crowdin 2021-12-21 00:08:24 +00: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
Manuel Alfayate Corchete
e5215d9e29
Fix incorrect file names for remap files when the content path doesn't have a preceding slash. (#13385) 2021-12-20 23:24:19 +01:00
Cthulhu-throwaway
77e202fbf7 Base64 cleanup
Base64 header cleanup.
2021-12-20 14:54:41 +01:00
Cthulhu-throwaway
568a30380b Buildfix for some platforms
Buildfix for some platforms that do not have HAVE_TRANSLATE defined aswell as platforms that define sockaddr_storage as sockaddr/sockaddr_in.
2021-12-20 14:26:50 +01:00
Cthulhu-throwaway
cae793e39f
Update netplay readme (#13380)
Fixes typos, removes outdated info and adds new commands for protocol 6.
2021-12-20 14:15:52 +01:00
github-actions
58b306d651 Fetch translations from Crowdin 2021-12-20 00:08:24 +00:00
Cthulhu-throwaway
cda66d09c3
Netplay Stuff - Addendum (#13378)
Prevents long-term pausing from clients dishonoring allow pausing.

Missing crediting.
2021-12-19 20:43:59 +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
github-actions
b7c14f61bc Fetch translations from Crowdin 2021-12-19 00:08:38 +00:00
arpruss
e5e6f343ac
convert abs mouse from screen to viewport coordinates; fix relative m… (#13258)
* convert abs mouse from screen to viewport coordinates; fix relative mouse code to work in screen mode

* C89 compatibility

* revert accidental include
2021-12-18 17:52:27 +01:00
Tony
698ab4729a
Vulkan max swapchain images option adjustments (#13374) 2021-12-18 17:45:32 +01:00
github-actions
7049c6c204 Fetch translations from Crowdin 2021-12-18 00:07:30 +00:00
Tony
8cc423e036
Logging cleanups (#13370) 2021-12-17 18:04:24 +01:00
Tony
6ee92d8583
Stop logging fps statistics twice on quit (#13369) 2021-12-17 16:06:15 +01:00
Tony
2c7d2bcc18
Log font rendering backend only once (#13371) 2021-12-17 16:05:32 +01:00