Commit Graph

79 Commits

Author SHA1 Message Date
Jamiras
a6beba6376
(cheevos) upgrade to rcheevos 11.2 (#16408)
* provide more information during achievement load process

* update rcheevos version

* do disconnected processing even when no game is loaded

* make loading widget unique

* only show loading indicator with verbose messages on
2024-04-05 07:39:38 -07:00
sonninnos
2e90ec9202
More widget corrections (#16296) 2024-02-26 20:59:43 -08:00
sonninnos
3c4dd50974
More widget additions and adjustments (#16287) 2024-02-25 20:23:08 -08:00
Jamiras
93e5566b9a
(cheevos) inform user when server is unreachable (#15970)
* ensure game placard is loaded on main thread

* show on-screen indicator while disconnected

* show server unreachable message in achievements menu

* remove comment
2023-12-02 05:33:13 -08:00
Jamiras
bbe7afcd82
(cheevos) use rc_client for state management (#15912)
* use rc_client for achievement processing

* log disconnect/reconnect messages

* address compiler warnings

* address c89 warning

* address c89 warning
2023-11-15 13:18:20 -08:00
Cpod12
274d47f957
Xunkar's AI service rework updated (#15640)
* AI service rework

* File missing

* Fixed C89 build

* Fixed usage of inline for C89 build

* Fixed an overlay unloading bug

Made sure to unload the overlay on release and when the server returns empty values in automatic modes.

* Fixed forward decl (c89)

* Fixed OpenGL texture loading

Moved image display to the main thread for now

* Changed some formatting slightly

* Fixed struct variable order and put brackets on newlines

* Moved pointer, fixed retroarch.cfg, and replaced strlcat with strlcpy

* Fixed catenation issue

* Fixed a few other catenation issues

* Fixed one more concatenation  issue

* Fixed concatenation issue

* Fixed a few other concatenation issues

* Fixed one more concatenation  issue

* potential fix for parsing issue

---------

Co-authored-by: Xunkar <329857+xunkar@users.noreply.github.com>
2023-10-24 00:27:06 -07:00
libretroadmin
37190f8036 Header uniformity cleanups 2023-05-30 21:21:05 +02:00
libretroadmin
c07e6a6da2 Cleanups 2023-05-30 20:30:37 +02:00
Jamiras
e2e193290c show tracker 2023-05-15 03:41:45 +02:00
libretroadmin
0c42e339e1 Silence some warnings that popup in Xcode 2023-01-04 18:42:35 +01:00
retroNUC
d24cdbfb15
Allow repositioning of RetroAchievement notifications (#14777)
* Allow repositioning of achievement notifications

* PS4/ORBIS build fix

Would have thought cheevos-related notification code was wrapped in HAVE_CHEEVOS, but guess not.
2022-12-30 16:55:38 +01:00
LibretroAdmin
f40d157571
Use flags pt3 (#14491)
* (Vulkan) Use flags for vulkan_emulated_mailbox

* Use flags for vk_texture

* dispgfx_widget - use flags instead of bools

* (Autoconfig) Use flags
2022-10-07 11:08:17 +02:00
LibretroAdmin
30eb0edcf8 Use flags for some structs instead of tons of bools - less state/variables to bookkeep,
less memory used
2022-10-06 06:53:13 +02:00
LibretroAdmin
0ffdd14940 Change msg_len of font driver to size_t - avoids all the type
casting/conversion
2022-09-02 01:10:28 +02:00
Jamiras
85c44f9245
more thread-awareness in task callbacks (#14337)
* more thread-awareness in task callbacks
2022-08-23 15:11:11 +02:00
LibretroAdmin
f472e4d0de (gfx_widgets) Call fill_pathname_application_special outside of hot functions
(gfx widgets) Pre-assemble and store paths that are not subject to change
2022-08-01 02:07:36 +02:00
libretroadmin
b6c9740ba3 Get rid of gfx_timer_t typedef - replace with float 2022-07-06 14:41:15 +02:00
libretroadmin
bb6937949d gfx_widget_draw_icon optimization - if radians is 0, we know cosine and
sine already. Avoid sinf/cosf computation when possible
2022-07-06 11:40:59 +02:00
libretroadmin
1798651041 (gfx_widgets) scale_enable can b set to false for widgets, scale_factor was always 1.0f
(XMB) set scale_enable to false when scale_factor is 1.0f
2022-07-05 14:18:20 +02: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
Jamiras
a3b508f136 show widget for loaded game 2021-11-16 08:26:42 -07:00
twinaphex
caccc410c6 Move gfx_widgets_ready to gfx_widgets.h 2021-10-13 17:51:46 +02:00
twinaphex
e72a88a98e Move some variables to widget state 2021-10-13 17:25:31 +02:00
twinaphex
b07d80efe1 gfx_widgets.h - add RETRO_BEGIN_DECLS/RETRO_END_DECLS 2021-09-30 15:29:57 +02:00
twinaphex
5ba8843354 Move dispwidget_get_ptr over to gfx_widgets.c 2021-09-30 04:40:15 +02:00
Jamiras
7919a87b97 show challenge indicators 2021-06-03 19:53:17 -06:00
twinaphex
e5e8e9b5d8 Expand widget init function 2021-04-08 00:51:10 +02:00
twinaphex
0674de54ee (gfx_widgets.c) Get rid of more pointer grabbing to
config_get_ptr/dispwidgets_get_ptr/etc
2021-03-25 15:05:09 +01:00
twinaphex
088e6b9e44 Move gfx_widgets_pure_white to dispwidget struct 2020-10-05 19:59:15 +02:00
twinaphex
90503f885b Move msg_queue_background to struct 2020-10-05 19:54:54 +02:00
twinaphex
f82b357f86 Remove getter gfx_widget_get_backdrop_orig 2020-10-02 22:12:05 +02:00
twinaphex
c45e7c9bc5 Cleanup 2020-10-02 11:36:11 +02:00
twinaphex
a38ecbe7de gfx_widgets_iterate - cleanup 2020-10-02 11:32:49 +02:00
twinaphex
fe38cd9cbc (gfx widgets) get rid of more getter functions 2020-10-01 10:55:37 +02:00
twinaphex
dee807cb54 (gfx widgets) Start removing a lot of getter functions 2020-10-01 10:50:45 +02:00
twinaphex
1e6828fd63 Cleanups 2020-09-30 19:18:40 +02:00
Jamiras
71cd400e56 add display widget for active leaderboards 2020-09-24 11:29:29 -06:00
twinaphex
c2cd39379a (gfx_widgets.c) Put FIFO queue on stack 2020-09-18 02:18:21 +02:00
twinaphex
5838817bbd Get rid of gfx_widgets_set_status_text 2020-09-14 14:11:44 +02:00
twinaphex
521050cf79 Remove gfx_widgets_get_pure_white 2020-08-31 23:46:24 +02:00
jdgleaver
2a58920e4e Improve appearance of 'generic_message' widget 2020-08-24 13:31:51 +01:00
jdgleaver
d43e92907e Improve appearance of 'libretro_message' widget 2020-08-21 11:33:27 +01:00
twinaphex
7ea2111936 Struct reorderings 2020-08-14 18:36:09 +02:00
twinaphex
659d50c916 Struct reorderings 2020-08-14 18:31:28 +02:00
Ryunam
4d2fe14c1d Adjustments to Screenshot Notification options 2020-07-20 19:44:55 +02:00
twinaphex
9fb54a0a1c Fix --disable-menu 2020-07-20 01:58:49 +02:00
Hugo Hromic
c3bf17d3f5 (Menu/OSD) Refactor "fps_text" into "status_text" internally
"fps_text" is used for several status parameters, not just FPS.
2020-07-19 16:58:58 +01:00
jdgleaver
506aa0a36c Add optional widget-based 'load content' launch feedback animation 2020-07-09 13:05:28 +01:00
jdgleaver
c48c26aff6 Add 'progress message' widget (for 'RETRO_MESSAGE_TYPE_PROGRESS' core messages) 2020-06-30 17:15:36 +01:00
twinaphex
f420c2c843 Change menu_widget_msg_t to disp_widget_msg_t 2020-06-27 01:15:21 +02:00