Commit Graph

1034 Commits

Author SHA1 Message Date
TÖRÖK Attila 755fa6cded chore: Switch `fluent-templates` back from `master` to `v0.9.0` 2024-03-04 11:05:08 +01:00
TÖRÖK Attila 9e8c406cd9 desktop: Introduce a `TaskKey` type for the slotmap in `executor.rs` 2024-03-03 21:18:39 +01:00
TÖRÖK Attila 5b920b8447 chore: Deduplicate the `fluent-templates` dependency 2024-03-02 19:54:00 +01:00
TÖRÖK Attila 55773f0205 chore: Replace `generational-arena` with `slotmap` 2024-03-02 19:42:11 +01:00
renovate[bot] 90bf13ebd2 fix(deps): update rust crate winit to 0.29.13 2024-03-02 19:17:37 +01:00
Kamil Jarosz a0f2941a2e desktop: Update winit to 0.29.12
This fixes critical crashes on X11
2024-03-01 12:10:37 +01:00
Crowdin Bot 4e87d34068 chore: Update translations from Crowdin 2024-03-01 11:15:11 +01:00
Tom Schuster a03355458f desktop: Add gamepad support using gilrs 2024-02-28 21:21:09 +01:00
Kamil Jarosz 9bc6700531 desktop: Get rid of busy waiting in connect_socket
This patch makes connect_socket await on recv
instead of spin and wake the CPU each 10 milliseconds.
2024-02-28 19:42:54 +01:00
Kamil Jarosz f5d52272ca desktop: Flush pending data before socket closes
This patch makes sure that any pending data is sent before
the socket closes. Without this fix Ruffle ignored the data sent
right before calling socket.close.
2024-02-28 19:42:54 +01:00
Kamil Jarosz f6907a5c73 desktop: Add tests for connect_socket
Add tests for ExternalNavigatorBackend::connect_socket.
2024-02-28 19:42:54 +01:00
Kamil Jarosz 2535b926a7 desktop: Add WinitFutureSpawner
This improves testability, decouples ExternalNavigatorBackend
from the event loop, and improves readability.

Instead of passing a channel to send the future to and an event loop
to poll, a WinitFutureSpawner is created which performs the
action of spawning a future and polling the event loop.
2024-02-28 19:42:54 +01:00
Kamil Jarosz cc8b0aa5dd core: Use async channels in NavigatorBackend
This has several advantages:
1. it allows using async variants of send and recv,
2. it adds consistency as until now Receiver was async,
   and Sender was not.
2024-02-28 19:42:54 +01:00
TÖRÖK Attila e56a4597cc desktop: chore: Update winit to 0.29.11 2024-02-27 22:43:59 +01:00
renovate[bot] 9cdb2f31cc fix(deps): update rust dependencies 2024-02-26 08:14:26 +01:00
TÖRÖK Attila d2e854fb73 nit: desktop/navigator: Fix a typo in a comment: ownerhsip -> ownership 2024-02-22 21:14:41 +01:00
Kamil Jarosz 98c0dc4616 desktop: Prevent resource leak on reload
This patch makes TaskHandle reference the executor by a weak reference.
Prior to this change, there was a possibility of a resource leak, where
the executor, its tasks, and resources held by them were not properly
dropped due to existing references to the executor.

This manifested by e.g. unclosed sockets after reload, which required
the whole program to be restarted in order to be closed properly.
2024-02-21 21:45:01 -05:00
renovate[bot] 6b89737093 fix(deps): update rust dependencies 2024-02-19 11:32:22 +01:00
renovate[bot] 1651b7a5b0 desktop: chore: Update `egui` to 0.26.2 2024-02-16 01:52:41 +01:00
Crowdin Bot 45c5d8f10c chore: Update translations from Crowdin 2024-02-12 00:25:24 +01:00
Crowdin Bot 5c6930d72e chore: Update translations from Crowdin 2024-02-09 17:56:24 +01:00
TÖRÖK Attila 28c380cfac desktop: Update egui to 0.26.0 2024-02-05 19:05:10 +01:00
Kamil Jarosz 50b5f29c0a text: Make enter add a new line in multiline fields 2024-02-03 13:40:07 +01:00
Kamil Jarosz 0657d2daa2 text: Add advanced horizontal text control codes 2024-02-01 20:18:29 +01:00
Crowdin Bot f64688f138 chore: Update translations from Crowdin 2024-01-30 23:55:48 +01:00
renovate[bot] 3737725a21 fix(deps): update rust dependencies 2024-01-30 09:23:15 +01:00
Nathan Adams e778e5ed58 desktop: Fix context menu, use new approach rather than trying to hack activate egui's menu 2024-01-27 09:44:31 +01:00
Crowdin Bot 4769a45999 chore: Update translations from Crowdin 2024-01-26 22:54:04 +01:00
arthomnix 3e82ba9a63 desktop: Allow specifying WGPU instance flags from environment 2024-01-26 22:33:18 +01:00
David Wendt 006c3af4b8 core: Add backend method for getting the expected length of a response. 2024-01-25 23:24:09 -07:00
David Wendt 91dd9563bb core: Add method to read downloads in chunks instead of all-at-once. 2024-01-25 23:24:09 -07:00
David Wendt 06eb2e1ee8 core: `Request` is now a trait. Body download is deferred to a second async method. 2024-01-25 23:24:09 -07:00
Crowdin Bot 917c1c08f7 chore: Update translations from Crowdin 2024-01-25 00:49:31 +01:00
Crowdin Bot a916f6e7a2 chore: Update translations from Crowdin 2024-01-23 23:01:01 +01:00
Crowdin Bot 430463ecd3 chore: Update translations from Crowdin 2024-01-23 12:38:25 +01:00
Aaron Hill dbcefd060f debug_ui: Add 'Show Domains' menu to view domains and classes
This opens a searchable list (similar to what we have for display
objects), which shows a tree of Domains and their associated classes.

Currently, clicking on the domain/class buttons doesn't do anything.
In a follow-up, I'm planning to add additional windows to display
information about a class.
2024-01-23 11:34:14 +01:00
renovate[bot] 262dff83a4 fix(deps): update rust dependencies 2024-01-22 03:09:33 +01:00
Nathan Adams 4d16e24889 wgpu: Update wgpu and naga to 0.19 2024-01-21 19:36:08 +01:00
Isao Mishima d7df55fd7b
desktop: Change the default Japanese fonts (#14877) 2024-01-21 15:21:48 +01:00
Tom Schuster e0f5b8906d desktop: Support device font with a non-zero index 2024-01-19 19:21:48 +01:00
Kamil Jarosz d89ab3dc83 desktop: Fix doubling inputted characters
Fix a bug introduced by f65060e8.
The text input event was triggered two times: at key press and release.
This patch makes sure that text input is triggered only on key press.
2024-01-18 00:21:19 +01:00
TÖRÖK Attila d153290fd6 nits: Fix a whole bunch of typos all over the place 2024-01-17 23:59:19 +01:00
Daniel Jacobs 8f2292c2c7 core: Add error for loading invalid SWF files and display as appropriate 2024-01-17 17:38:47 -05:00
Nathan Adams f65060e8c9 desktop: Update winit to 0.29.10 and egui to 0.25.0 2024-01-16 21:10:36 +01:00
renovate[bot] 3c115238fd fix(deps): update rust dependencies 2024-01-16 01:13:38 +01:00
Crowdin Bot 3f17d1c778 chore: Update translations from Crowdin 2024-01-16 00:48:30 +01:00
TÖRÖK Attila 078b264c19 desktop: Support F13..F24 keys 2024-01-11 22:40:37 +01:00
Nathan Adams d89e4536b3 core: Support Japanese font defaults 2024-01-10 23:15:26 +01:00
Crowdin Bot 6e1e26e0e8 chore: Update translations from Crowdin 2024-01-08 23:28:34 +01:00
Tom Schuster 4db87a9643 desktop: define default fonts 2024-01-08 23:00:18 +01:00
Tom Schuster 2a2bcbbfbc desktop: Load device fonts from system 2024-01-08 23:00:18 +01:00
renovate[bot] a328deab11 fix(deps): update rust dependencies 2024-01-08 02:59:04 +01:00
Crowdin Bot 1325181a59 chore: Update translations from Crowdin 2024-01-06 09:30:28 +01:00
TÖRÖK Attila 217585daa8 chore: Delegate `[lints]` in `Cargo.toml` of all packages to the workspace 2024-01-05 11:28:19 +01:00
renovate[bot] 91d0520a43 fix(deps): update rust dependencies 2024-01-01 02:03:54 +01:00
renovate[bot] 216a8f3b14 fix(deps): update rust dependencies 2023-12-25 10:09:07 +01:00
Crowdin Bot 9523022cdd chore: Update translations from Crowdin 2023-12-23 13:26:37 +01:00
TÖRÖK Attila f9aa6dbea4 chore: Fix a beta clippy lint: `clippy::blocks_in_conditions` 2023-12-23 13:06:47 +01:00
Tom Schuster e3d8a279ad core: load_device_font register function must be &mut 2023-12-22 13:47:48 +01:00
Crowdin Bot ba6ba842d7 chore: Update translations from Crowdin 2023-12-18 23:28:34 +01:00
renovate[bot] 0e5ef32654 fix(deps): update rust dependencies 2023-12-18 08:16:28 +01:00
nosamu 989988631f desktop: Fix egui scaling
Fixes #14413
2023-12-17 22:14:14 -08:00
Aaron Hill 287ca8801a avm2: Implement AIR playerglobal versioning
This builds on our existing playerglobal versioning support
to add in AIR versioning. We closely follow the avmplus implementation:

* When an SWF is loaded, we chose either a FlashPlayer or AIR
APIVersion for its SWF version, based on our configured player runtime.
* When loading playerglobals, we look at the player runtime. In AIR
  mode, we map FlashPlayer-versioned definitions to the closest AIR
  version. This ensures that all runtime APIVersions are in the
  same series (either AIR or FlashPlayer). In FlashPlayer mode,
  all AIR-versioned definitions get mapped to VM_INTERNAL, hiding
  them from user code.

Part of our existing api versioning code was implemented incorrectly.
Within playerglobals, we need to treat all unmarked namespaces as
VM_INTERNAL - this allows things like playerglobal script
initializer "initproperty" opcodes to see any VM_INTERNAL AIR
definitions (when we run under FlashPlayer mode). Previously, we
were using AllVersions, which would result in those VM_INTERNAL
definitions being hidden from other playerglobal code, which is
not correct.

Using this support, I've added a stub for the AIR-only
'flash.net.DatagramSocket'. I've also extended the test framework
with a new 'player_options.runtime' config option, which can be
set to "AIR" or "FlashPlayer" to configure the test runtime mode.

I've also added two new tests:
* 'air_hidden_lookup' runs under the FlashPlayer runtime, and verifies
  that a list of classes (currently just "DatagramSocket" are
  inacessible).
* 'air_datagram_socket', which uses `player_options.runtime = "AIR"`
  to construct an instance of `flash.net.DatagramSocket`. We can
  extend this test once we implement more of `DatagramSocket`

With this commit, we have all of the needed infrastructure to start
implementing and testing AIR-only classes and methods.
2023-12-16 19:11:50 -05:00
TÖRÖK Attila bf9cf92af8 render/wgpu: Update wgpu to 0.18.0, naga to 0.14.1, naga_oil to 0.11.0, egui to 0.24.1 2023-12-14 01:36:42 +01:00
Tom Schuster 0fad4c23d2 desktop: Also spoof top.location.href 2023-12-13 20:10:39 +01:00
Crowdin Bot 9a02ca76ff chore: Update translations from Crowdin 2023-12-12 19:08:09 +01:00
bi4k8 4d07e43bc4
desktop: Add "wayland-data-control" feature for arboard
This fixes a crash on start when running under Wayland.
2023-12-11 10:08:15 +00:00
renovate[bot] 40b92e69f7 fix(deps): update rust dependencies 2023-12-05 21:08:16 +01:00
Crowdin Bot 9477856079 chore: Update translations from Crowdin 2023-12-02 23:25:09 +01:00
TÖRÖK Attila 4c8a5714b8 chore: Bump `tracing-tracy` to 0.10.4 to match `profiling`
And avoid "span! without a running Client" errors due to
duplicate `tracy-client` dependency.
2023-11-29 13:11:07 +01:00
renovate[bot] 6da223a875 fix(deps): update rust dependencies 2023-11-27 09:44:47 +01:00
Aaron Hill 993d8d9f9b core: Add PlayerRuntime::{FlashPlayer, AIR} for Adobe AIR support
We've now had two different bug reports involving Adobe AIR
SWFs, so I'm going to go ahead and start adding a framework
for AIR support.

This commit just adds a command-line option
`--player-runtime <flash-player|air>` (defaulting to `flash-player`),
and passes it along to the `Player`. The actual value is currently
unused - in a follow-up PR, I'm going to implement namespace versioning
for AIR.
2023-11-25 19:05:51 -05:00
Lord-McSweeney d3b9d8a451 dekstop: Support `quit` and `fullscreen` fscommands 2023-11-25 15:49:02 -08:00
Crowdin Bot 66c6c176f0 chore: Update translations from Crowdin 2023-11-25 22:45:02 +01:00
MrCheeze 5920a6426e core: Allow Regular/Bold/Italic device fonts to be registered separately 2023-11-24 17:08:35 +01:00
Tom Schuster 96059a8e25 avm2: Implement flash.system.Security pageDomain 2023-11-23 19:55:32 +01:00
Tom Schuster 48102a20a2 desktop: Add window.location.href spoofing to the fake ExternalInterface 2023-11-23 19:12:34 +01:00
Tom Schuster a113d96fdd desktop: Include file path in IO error message 2023-11-22 23:59:46 -05:00
Crowdin Bot d1784dc7c8 chore: Update translations from Crowdin 2023-11-23 00:38:05 +01:00
renovate[bot] 7757d060ff fix(deps): update rust dependencies to v2 2023-11-20 09:03:08 +01:00
renovate[bot] 32c65e6460 fix(deps): update rust dependencies 2023-11-13 09:10:26 +01:00
Nathan Adams 424821724f desktop: Show ruffle logo in about dialog 2023-11-12 21:42:02 +01:00
Crowdin Bot 1c4380f633 chore: Update translations from Crowdin 2023-11-07 12:40:56 +01:00
CUB3D b0d88645bc avm1: Implement FileReference 2023-11-03 19:32:24 +01:00
renovate[bot] 1377a5b07b fix(deps): update rust dependencies 2023-11-01 00:45:43 +01:00
renovate[bot] 7b3ae30fbf fix(deps): update rust crate async-io to v2 2023-10-23 13:05:02 +02:00
Crowdin Bot 1ca5f714f9 chore: Update translations from Crowdin 2023-10-23 03:21:14 +02:00
renovate[bot] cd01bfe7d6 fix(deps): update rust dependencies 2023-10-23 02:55:11 +02:00
Crowdin Bot 94174b30fe chore: Update translations from Crowdin 2023-10-20 21:10:35 +02:00
Crowdin Bot e6f9796094 chore: Update translations from Crowdin 2023-10-17 23:31:22 +02:00
renovate[bot] b427940431 fix(deps): update rust dependencies 2023-10-16 09:51:22 +02:00
Crowdin Bot 0127c98fdf chore: Update translations from Crowdin 2023-10-15 19:17:00 +02:00
Nathan Adams ec21ad8658 core: Add default_font feature which enables the fallback font 2023-10-15 14:09:21 +02:00
Nathan Adams 74a7ab5afe core: Implement device font lookup, and multiple default device fonts 2023-10-15 14:09:21 +02:00
Crowdin Bot 2422793d1b chore: Update translations from Crowdin 2023-10-11 13:29:12 -04:00
TÖRÖK Attila 602154b1b7 core,desktop: Switch to egui v0.23.0
Since it's compatible with wgpu 0.17.x.
2023-10-09 18:51:01 -04:00
Crowdin Bot 13b50fecb5 chore: Update translations from Crowdin 2023-10-09 23:10:41 +02:00
Crowdin Bot 3dc75f7ab8 chore: Update translations from Crowdin 2023-10-07 23:37:34 +02:00
renovate[bot] 428e89af73 fix(deps): update rust dependencies 2023-10-04 19:19:51 -04:00
sleepycatcoding 4bfd2fc978 desktop: Make jpegxr optional
This is enabled for CI builds.
2023-10-03 16:08:51 -04:00
Aaron Hill 25cf77c4a2 desktop: Handle cookies and Content-Type for HTTP requests
Both of these are handled automatically by the browser in the
web backend. This makes the desktop client store cookies between
requests (though they are discarded when the desktop player is closed),
and set the "Content-Type" header based on the mime-type supplied
in the URLRequest.
2023-10-02 19:41:39 -04:00
Crowdin Bot 58b18e282b chore: Update translations from Crowdin 2023-10-02 00:57:34 +02:00
sleepycatcoding f140e7a14b
core: Place jpegxr texture support behind feature flag (#13348) 2023-09-29 18:46:54 -04:00
Crowdin Bot c3d0540a6e chore: Update translations from Crowdin 2023-09-29 18:28:15 +02:00
renovate[bot] 7e4e4d4c5b fix(deps): update rust dependencies 2023-09-25 11:14:39 +02:00
Crowdin Bot bd67a5845b chore: Update translations from Crowdin 2023-09-24 12:13:31 +02:00
Crowdin Bot 5b9806bdb3 chore: Update translations from Crowdin 2023-09-19 23:41:23 +02:00
Crowdin Bot 695c2ff9f5 chore: Update translations from Crowdin 2023-09-18 00:03:15 +02:00
TÖRÖK Attila d7d5928c21 chore: Follow rfd API change (set_description) 2023-09-18 00:00:45 +02:00
TÖRÖK Attila b8190660aa chore: Follow rfd API change (MessageDialogResult) 2023-09-18 00:00:45 +02:00
renovate[bot] 37e2c06034 fix(deps): update rust dependencies 2023-09-18 00:00:45 +02:00
Crowdin Bot 8885c35c54 chore: Update translations from Crowdin 2023-09-17 22:45:09 +02:00
Crowdin Bot 7f416f85a8 chore: Update translations from Crowdin 2023-09-14 23:50:25 +02:00
Positron832Alt 591e4b4da1
desktop: Change "Open URL Mode" to "Open Links" (#13099) 2023-09-13 22:33:17 +02:00
Aaron Hill 1c0ae0b6d8 render: Bump wgpu to 0.17 and naga to 0.13 2023-09-07 18:49:59 -04:00
Kornelius Rohrschneider 53ba75d587 Move logarithmic volume transformation to AudioMixer
Previously, the volume transformation to adapt the volume for
logarithmic hearing has been performed in the VolumeControls Rust struct
and TypeScript class each.
Since this calculation is the same on desktop and web and should be
implemented in the audio backend, it has been moved into the
AudioMixer::mix_audio method.
The VolumeControls struct and class now only calculate the linear volume
out of the checkbox and the slider.
Player::set_volume and Player::volume now don't take and return the
adapted volume, but use the linear volume (which gets saved internally).
2023-09-07 00:51:58 +02:00
Kornelius Rohrschneider a550a998c3 desktop: Add desktop volume controls
The desktop version of Ruffle now has a volume controls window. It can
be accessed through the menu bar (Controls > Volume controls).
It contains a mute button and a slider from 0 to 100.

The volume settings set in the GUI are saved in a new VolumeControls
struct, which is also used to calculate the real volume (adapted for
logarithmic hearing) out of the entered volume and the mute checkbox.
As soon as the volume is changed in the GUI, the real volume will be set
in the player (if the player exists).

The player doesn't set its volume level according to the PlayerOptions
after its creation anymore. Instead, RuffleGui::on_player_created now
gets the player and sets its volume to the real volume set in the GUI.
The volume in the GUI itself defaults to the PlayerOptions value.
This also fixes the issue that the PlayerOptions volume has previously
not been adapted for logarithmic hearing.

The existing ftl files have been adapted (and new ones have been
created) to include the new multilingual text in the menu bar and the
volume controls window.
2023-09-07 00:51:58 +02:00
renovate[bot] dabc2d56b9 fix(deps): update rust dependencies 2023-09-04 10:25:24 +02:00
Crowdin Bot 2996f97578 chore: Update translations from Crowdin 2023-09-02 15:43:08 +02:00
renovate[bot] 4e75c3890a fix(deps): update rust dependencies 2023-08-28 07:39:35 +02:00
Crowdin Bot 3ccda582e1 chore: Update translations from Crowdin 2023-08-25 11:50:24 +02:00
David Wendt 7158039135 audio: Audio streamed from FLVs do not have the SWF MP3 header 2023-08-23 15:36:20 -06:00
renovate[bot] 2f4c7d2fe3 fix(deps): update rust dependencies 2023-08-21 08:59:07 +02:00
renovate[bot] 1f4bfcf10d fix(deps): update rust dependencies 2023-08-18 23:32:15 +02:00
Crowdin Bot 96faa8c5ce chore: Update translations from Crowdin 2023-08-18 00:54:46 +02:00
Crowdin Bot 56b97e7b40 chore: Update translations from Crowdin 2023-08-13 20:04:29 +02:00
Crowdin Bot 8e1632ab22 chore: Update translations from Crowdin 2023-08-11 10:23:54 +02:00
Crowdin Bot 205ef09cc6 chore: Update translations from Crowdin 2023-08-08 23:49:31 +02:00
renovate[bot] a4b179e1e0 chore(deps): lock file maintenance rust dependencies 2023-08-08 23:19:16 +02:00
sleepycatcoding ba5eb9532b desktop: Fix --no-gui issues 2023-08-08 18:25:45 +02:00
Daniel Jacobs dbb5e381f2 core/desktop/web: Play unsupported videos with browser 2023-08-07 14:31:33 -06:00
Lord-McSweeney 66df964709 desktop: Don't wrap context menu item text; support enabled/disabled ctx menu items 2023-08-05 22:06:10 +02:00
Crowdin Bot 98c286e997 chore: Update translations from Crowdin 2023-08-04 17:18:58 +02:00
sleepycatcoding ad5f087baa desktop: Add --no-gui flag 2023-08-02 22:34:25 +02:00
sleepycatcoding d7b6e588d0 desktop: Use new socket API 2023-07-31 22:32:03 +02:00
Crowdin Bot 739583c35c chore: Update translations from Crowdin 2023-07-30 23:36:20 +02:00
Crowdin Bot 64b705a8c5 chore: Update translations from Crowdin 2023-07-30 16:33:54 +02:00
Crowdin Bot 82b88ebff5 chore: Update translations from Crowdin 2023-07-29 00:11:13 +02:00
Crowdin Bot 2455a5f1b7 chore: Update translations from Crowdin 2023-07-28 19:47:33 +02:00
Crowdin Bot 280de7cd61 chore: Update translations from Crowdin 2023-07-27 16:39:17 +02:00
Nathan Adams 55906c22fa desktop: Change 'socket mode' text to 'TCP Connections' 2023-07-26 19:44:39 +02:00
Nathan Adams 1a0a82d898 core: Move fscommand execution outside of ExternalInterfaceProvider, so it can be implemented without causing ExternalInterface.available to become true 2023-07-26 17:00:15 +02:00
renovate[bot] 3e63a88c34 chore(deps): lock file maintenance rust dependencies 2023-07-25 08:23:28 +03:00
sleepycatcoding a432b1cbca desktop: Split read/write tasks for TcpStream
This should improve latency as we no longer wait for writing.
2023-07-23 09:13:01 +02:00
sleepycatcoding 4db16b76ab Chore: fmt 2023-07-23 09:13:01 +02:00
sleepycatcoding a82658687e desktop: Update en-US translation file 2023-07-23 09:13:01 +02:00
sleepycatcoding 74b66fdd73 core+desktop: Rename SocketBehavior to SocketMode
Also change command line flag from --socket to --socket-mode
2023-07-23 09:13:01 +02:00
sleepycatcoding d7421a9812 desktop: Default socket behavior to ask 2023-07-23 09:13:01 +02:00
sleepycatcoding 7cb6998991 chore: fmt 2023-07-23 09:13:01 +02:00
sleepycatcoding 4c6ce79210 desktop: Differentiate between TimedOut and Failed connection 2023-07-23 09:13:01 +02:00
sleepycatcoding caddd5512b desktop: remove Option for connection timeout 2023-07-23 09:13:01 +02:00
sleepycatcoding 4501bc19c4 chore: allow clippy::too_many_arguments 2023-07-23 09:13:01 +02:00
sleepycatcoding b46cc2aadc desktop: remove unneeded comment 2023-07-23 09:13:01 +02:00
sleepycatcoding c0ebafdb95 desktop: Use provided timeout when connecting 2023-07-23 09:13:01 +02:00
sleepycatcoding df4ee7fe05 Chore: Fmt 2023-07-23 09:13:01 +02:00
sleepycatcoding 2bcfc25b9f desktop: Add socket behavior to OpenDialog 2023-07-23 09:13:01 +02:00
sleepycatcoding 22eb150756 desktop: add SocketBehavior and host whitelist
This adds a way to modify socket behavior to restrict, ask, or allow all
connections. Also adds a whitelist which can be used to allow specific hosts
without enabiling ask or allow all behaviors.
2023-07-23 09:13:01 +02:00
sleepycatcoding 41a63e3bef desktop: make socket connections async
This also fixes an unrelated bug where null bytes were added to data, this
broke data parsing.
2023-07-23 09:13:01 +02:00
sleepycatcoding 8f6aab56e0 desktop: correct TcpStream reading
This was incorrect as this pr was initially based on #8188.
Old code was searching for XML payload end null bytes, now it just reads
and appends bytes.
2023-07-23 09:13:01 +02:00
sleepycatcoding 8c221653ff desktop: Implement connect_socket 2023-07-23 09:13:01 +02:00
Nathan Adams 586c3bebf6 core: Remove unsupported content warning 2023-07-22 23:08:42 +02:00
Aaron Hill c19fc1b72c desktop: Set max_execution_duration to Infinity by default
The `max_execution_duration` feature is pretty much useless on desktop,
and breaks slow SWFs by aborting script execution instead of letting
it continue.
2023-07-20 16:25:49 -04:00
Crowdin Bot b2afcbaf3e chore: Update translations from Crowdin 2023-07-20 13:41:04 +02:00
Nathan Adams 2729da8ec0 desktop: Send wgpu stats to tracy 2023-07-19 21:36:30 +02:00
Nathan Adams 5597535471 wgpu: Store wgpu::Instance in Descriptors 2023-07-19 21:36:30 +02:00
Nathan Adams 030c3c50e8 wgpu: Make `request_adapter_and_device` take in wgpu::Instance by ref 2023-07-19 21:36:30 +02:00
Crowdin Bot 50c819295c chore: Update translations from Crowdin 2023-07-17 21:15:43 +02:00
renovate[bot] 268403faad chore(deps): lock file maintenance rust dependencies 2023-07-17 09:55:56 +03:00
Kornelius Rohrschneider a0d0b8e638 core: Refactor & improve NavigatorBackend implementations
All NavigatorBackend implementations have been refactored, resulting in
improved code quality, less duplicated code, more consistent and easier
to understand procedures, additional error handling and better error
messages.

A resolve_url method has been added to the NavigatorBackend trait. It
takes a URL and and resolves it to the actual URL from which a file can
be fetched (including handling of relative links and pre-processing). It
has been implemented in each NavigatorBackend implementation.

Duplicated code has been put into new public functions in
core/src/backend/navigator.rs which are called by all NavigatorBackend
implementations.

ExternalNavigatorBackend:
- The navigate_to_url and fetch methods have been adapted to use
  resolve_url, removing redundant code.
- Error handling has been added in case that the URL can't be converted
  to a PathBuf.
- A TODO about differences between the flash player fetch and the
  Ruffle fetch implementation has been added.

WebNavigatorBackend:
- The previous resolve_url method exclusively to the WebNavigatorBackend
  has been replaced by the new resolve_url method. It is used by
  navigate_to_url and fetch.
- resolve_url now always pre-processes the URL if it's valid (even if no
  base_url exists) and explicitly returns whether the URL can be parsed.
- navigate_to_url now traces an explanatory error each if the URL can't
  be parsed or is local.
- fetch now returns an explanatory error each if the URL can't be parsed
  or is local (previously, a vague "Got JS error" has been returned).

TestNavigatorBackend & NullNavigatorBackend:
- fetch pre-processes the URL now (using the resolve_url implementation).
- If the URL isn't local, an explanatory error is returned (previously,
  it was just an "Invalid URL" error).
- If the URL can't be parsed, an explanatory error with the reason is
  returned (previously, it was just an "Invalid URL" error).

Additionally, error messages in all NavigatorBackend implementations
have been improved and made more consistent, e.g. if a local file can't
be read.
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider 893052c2a6 core: Add MovieClip error state
A load_error_swf function has been added to the Loader. It makes the
MovieClip enter the error state in which some attributes have certain
error values to signal that no valid file could be loaded. This happens
if no file could be loaded or if the loaded content is no valid
supported content.
The function creates an error state movie stub using the new
SwfMovie::error_movie function (which uses a new default_error_header
function) and configures remaining variables with the
movie_not_available method.
One TODO in order for the error state to be completely implemented has
been added.

Since the error state of the MovieClip includes the final URL of the SWF
file obtained after any redirects, the load_error_swf and
movie_loader_error functions (now) take an swf_url attribute.
To get this URL in case no file could be loaded, the
NavigatorBackend::fetch method has been changed to return an
ErrorResponse struct (including the url and the actual error) in the
error case. The Response struct returned in the success case has been
renamed to SuccessResponse.
All fetch implementations have been adapted accordingly. Code has been
adjusted to return the actual error where that's needed.

Documentation has been added and improved.
2023-07-17 00:08:02 +02:00
renovate[bot] f0607d6a1f chore(deps): lock file maintenance rust dependencies 2023-07-11 22:42:51 +02:00
nosamu db252dabc3 desktop: Use consistent wording for removing parameters 2023-07-10 21:25:04 +02:00
nosamu eeca059aeb desktop: Add Letterbox option to Open Advanced dialog 2023-07-10 21:25:04 +02:00
Crowdin Bot 460e176ea9 chore: Update translations from Crowdin 2023-07-10 08:47:20 +02:00
Daniel Jacobs e159ff8b35 desktop: Make Linux font selection work like Windows 2023-07-09 23:48:25 -04:00
nosamu c60742428c desktop: Use suitable CJK fonts for each language on Windows 2023-07-06 21:42:02 +02:00
tinaun 57ede6e1f2 desktop: load cjk fallback fonts using fontdb 2023-07-06 21:42:02 +02:00
Aaron Hill 009fab1889 core: Expose `LoaderInfo.parameters` and fix other properties
When using a 'Loader', properties on the 'contentLoaderInfo' become
set during specific events in the load sequence. In particular,
'LoaderInfo.bytesTotal' becomes available during the first 'progress'
event.

Also, 'LoaderInfo.parameters' is now properly set from the URL query
parameters. In Flash player, this work even with filesystem urls
(e.g. 'file:///some/path/to/file.txt?paramOne=valOne' will load
a file named 'file.txt', setting and expose the parameter 'paramOne'
with value 'valOne' in `LoaderInfo.parameters`). This required some
cleanup to the desktop and test NavigatorBackend impls to strip
out query parameters when loading a parameter from disk.

Previously, we would set `SwfMovie.parameters` manually from the url.
Now, the various `SwfMovie` constructors automatically extract
query parameters from the provided url. Outside of `SwfMovie`,
we only append *extra* parameters (e.g. those set from `flashvars`).

This makes CPMStar ads work, since the loaded SWF needs to access
`LoaderInfo.parameters`
2023-07-05 19:47:16 -04:00
Crowdin Bot 36a950cf1e chore: Update translations from Crowdin 2023-07-05 18:57:39 +02:00
Aaron Hill 2499db4874 desktop: Use Rc and RefCell for non-thread-safe types 2023-07-04 20:50:46 +02:00
Crowdin Bot ad7e73f77b chore: Update translations from Crowdin 2023-07-03 20:38:26 +02:00
renovate[bot] 13b1078142 chore(deps): lock file maintenance rust dependencies 2023-07-03 08:28:13 +03:00
Aaron Hill 2bcfabef53 desktop: Use `SubscriberInitExt::init` to capture `log` output
This method redirects output from the `log` crate to `tracing`,
which lets us get naga/wgpu logs.
2023-07-02 15:38:35 -04:00
Aaron Hill 6e1f00edf2
render: Implement more PixelBender features (#11800) 2023-07-01 13:50:43 -04:00
Nathan Adams 5e608764ec core: Add debug feature to find display objects by mouse 2023-07-01 12:58:32 +02:00
Crowdin Bot 29a5c6a4cd chore: Update translations from Crowdin 2023-07-01 00:47:31 +02:00
Crowdin Bot 1430e98851 chore: Update translations from Crowdin 2023-06-28 23:19:47 +02:00
lvyitian 9f67d3c238 Formatting 2023-06-27 21:37:28 +03:00
lvyitian e43a9fd85f [desktop][chore] Fix incorrect linker arguments on windows when using gnu linker(ld.exe) 2023-06-27 21:37:28 +03:00
renovate[bot] 3057aa59dd chore(deps): lock file maintenance rust dependencies 2023-06-25 21:53:00 -04:00
Crowdin Bot 9e066bc14f chore: Update translations from Crowdin 2023-06-24 19:58:34 +02:00
Crowdin Bot b1149cd267 chore: Update translations from Crowdin 2023-06-23 11:49:47 +02:00
Crowdin Bot e0cc7f1e54 chore: Update translations from Crowdin 2023-06-22 14:38:34 +02:00
Nathan Adams 00e02d1511 core: Add debug window to list known movies 2023-06-21 18:27:12 +02:00
Nathan Adams 647006b8d0 core: Add more avm2 debug info 2023-06-21 18:27:12 +02:00
Nathan Adams b24cc60a5d core: Add swf info to debug menu 2023-06-21 18:27:12 +02:00
Crowdin Bot 67a5a2923f chore: Update translations from Crowdin 2023-06-20 23:52:03 +02:00
TÖRÖK Attila 599488f0d6 cleanup: Rename GlutinAsyncExecutor -> WinitAsyncExecutor.
It should probably have been renamed as part of, or shortly after, f0445d94b
2023-06-18 14:54:07 +02:00
Crowdin Bot 73482c6e72 chore: Update translations from Crowdin 2023-06-18 01:02:34 +02:00
Crowdin Bot ca549e482c chore: Update translations from Crowdin 2023-06-17 19:25:33 +02:00
renovate[bot] 7a21756ddb chore(deps): lock file maintenance rust dependencies 2023-06-17 11:00:52 -05:00
TÖRÖK Attila 12a28b0c5b chore: Bump `tracing-tracy` to version-match `profiling`
This fixes `thread 'main' panicked at 'span! without a running Client'`
when enabling the `tracy` feature.
2023-06-17 12:12:46 +02:00
Aaron Hill 69fce3f7f8
wpgu: Initial implementation of PixelBender shader execution (#11441)
* wpgu: Initial implementation of PixelBender shader execution

The implementation is split across four crates:
* `ruffle_render` now holds the main PixelBender bytecode parsing
   implementation (previously, this was in `ruffle_core`).
* `ruffle_core` holds some helper functions for converting between
   AVM2 `Value`s and the PixelBender vector types.
* `naga-pixelbender` (newly created) constructs a Naga `Module`
  from parsed PixelBender bytecode
* `ruffle_render_wgpu` sets up the render pipeline for the shader
  constructed by `naga-pixelbender`, and actually executes the shader.

The Actionscript-side shader parameters are passed in through uniforms.
This allows us to cache the compiled `naga::Module` and associated
wgpu types inside `ShaderData`, when it's first created. Each invocation
of a `ShaderJob` only needs to create a bind group and render pass.

Limitations:

* Only a few of the PixelBender opcodes are implemented - however, this is
enough to get Stemlands cannon rotation working, as well as a cool
"donut" shader that I found and included as a test.
* PixelBender matrix types are not supported.
* Only BitmapData is supported as an input/output type - Flash Player
  also supports using Vector and ByteArray
* ShaderJob execution is always synchronous.

* Adjust comments

* Address review comments
2023-06-15 22:50:24 +00:00
Crowdin Bot 56a87dec50 chore: Update translations from Crowdin 2023-06-15 13:10:16 +02:00
Aaron Hill cd2c7f6f2f tests: Enable tracing_subscriber in tests
Previously, we weren't displaying any Ruffle logs when running tests.
2023-06-14 17:15:31 -05:00
nosamu 202fe2f1bb core: Add options to set and force the stage alignment 2023-06-14 16:04:14 +02:00
Nathan Adams 0b86c02c5c desktop: Fix interaction between egui and ruffle cursors 2023-06-14 13:43:17 +02:00
Crowdin Bot 942842c47a chore: Update translations from Crowdin 2023-06-14 12:13:18 +02:00
Crowdin Bot 834297f110 chore: Update translations from Crowdin 2023-06-12 12:28:05 +02:00
Moulins da6e2a96bf desktop: properly populate base and proxy URL fields from option struct
Fixes #11461
2023-06-11 12:46:13 -05:00
Crowdin Bot e8925832a1 chore: Update translations from Crowdin 2023-06-10 10:09:19 +02:00
AllinolCP 44ff49aa53
core: Fix status code implementation for AVM1 and implement HTTPStatusEvent.HTTP_STATUS for avm2 (#11360) 2023-06-10 03:06:26 +00:00
renovate[bot] a621472336 chore(deps): lock file maintenance rust dependencies 2023-06-09 20:17:25 +03:00
doomsdayrs 16210cbcf6 desktop: Add reverse engineered logo svg
There was no source file for the various logos.

I used the icon file provided by @nosamu and used existing pngs to recreate the style of the logo.
2023-06-09 18:21:56 +02:00
Nathan Adams 6ec01f3ecb desktop: Add dummy External Interface option 2023-06-09 13:03:46 +02:00
Aaron Hill 66f3198f50 desktop/web: Increase stack size on Windows and wasm
This works around a stack overflow with Bloonts Tower Defense 5,
where we have over 400 stack frames at once due to deep
`construct_frame` recursion in `goto` execution.
2023-06-08 22:17:27 -05:00
Crowdin Bot 650f872b19 chore: Update translations from Crowdin 2023-06-09 01:51:23 +02:00
Moulins fcd9935a81 desktop: Add `File > Reload` menu command
Also remove redundant `has_movie` parameter in `RuffleGui::update`
2023-06-09 00:42:03 +02:00
Moulins c1a3caefea desktop: point `Open Advanced`'s file dialog to the current file's directory 2023-06-09 00:42:03 +02:00
Moulins d7a056df8e desktop: keep options in-sync when using `Open` or drag-and-dropping a file 2023-06-09 00:42:03 +02:00
Moulins ac69926b5e desktop: add `Ctrl+Shift+O` shortcut for `Open Advanced` 2023-06-09 00:42:03 +02:00
Moulins 08fe4a4c94 desktop: Add button to clear all movie params. in `Open Advanced` 2023-06-09 00:42:03 +02:00
Moulins 5e1716d7e8 desktop: remember `Open Advanced` options across movie loads
Makes opening the same movie repeatedly less tedious.

Note that `Open` still ignore this and will use the default options
provided on the command-line.
2023-06-09 00:42:03 +02:00
Crowdin Bot 93f5869005 chore: Update translations from Crowdin 2023-06-08 00:57:49 +02:00
Crowdin Bot 808deaa378 chore: Update translations from Crowdin 2023-06-05 09:00:51 +02:00
renovate[bot] f1fe998869 chore(deps): lock file maintenance rust dependencies 2023-06-04 22:53:18 -05:00
Crowdin Bot 9767ffca96 chore: Update translations from Crowdin 2023-06-03 15:58:24 +02:00
Nathan Adams 16ce9aa437 core: Add debug rects to debugger 2023-06-03 09:11:06 +02:00
Nathan Adams e12e2a2e54 core: Initial Debug UI 2023-06-03 09:11:06 +02:00
Adrian Wielgosik c8fc810fa6 desktop: rewrite AS3 warning popup in egui 2023-05-31 23:21:30 +02:00
Adrian Wielgosik 5d3544ddc7 desktop: Simple hack to stop ignoring egui redraws 2023-05-30 23:55:31 +02:00
Crowdin Bot 6dc3743f4b chore: Update translations from Crowdin 2023-05-30 23:21:28 +02:00
tinaun ff518b9deb use light menus on light theme & detect changes 2023-05-30 23:07:09 +02:00
Adrian Wielgosik 8d6c08df4d Desktop: Stop busy looping when idling 2023-05-29 22:51:40 +02:00
Nathan Adams d99415c644 desktop: Don't use winit workaround for File->Open, to avoid unresponsive ruffle in that case alone 2023-05-29 22:12:56 +02:00
Nathan Adams 59d917b15a desktop: Default open the Advanced Open dialog 2023-05-29 22:12:56 +02:00
Nathan Adams 0c10e2a7b7 desktop: Add advanced open dialog 2023-05-29 22:12:56 +02:00
Nathan Adams 9e9ee361c4 desktop: Pass PlayerOptions when loading swfs, defaulting to the CLI args 2023-05-29 22:12:56 +02:00
Nathan Adams a86aff07a6 desktop: Use new PlayerOptions struct for player building, not CLI args directly 2023-05-29 22:12:56 +02:00
Nathan Adams 558fea2a7c desktop: Add PlayerController:handle_event that also checks for player pause status 2023-05-29 21:23:00 +02:00
Nathan Adams 101277a32b desktop: Add suspend/resume buttons 2023-05-29 21:23:00 +02:00
renovate[bot] 847dece735 chore(deps): lock file maintenance rust dependencies 2023-05-28 23:54:33 -05:00
Aaron Hill 14c6d1d959 avm2: Implement URLRequest.requestHeaders
These are directly set on the underlying navigator's HTTP
request type, and get printed out in our test navigator backend.

No validation of the header names is performed - on web, this will be
enforced by the browser.
2023-05-28 12:07:37 -05:00
Crowdin Bot e98230c988 chore: Update translations from Crowdin 2023-05-27 00:34:44 +02:00
TÖRÖK Attila 6d76e9669c nit: Github -> GitHub 2023-05-25 10:40:47 +02:00
Nathan Adams defe4d8308 desktop: Support dropping swfs onto the player 2023-05-24 23:50:48 +02:00
Nathan Adams 3e35e7887a desktop: Add a few comments about Player related structs 2023-05-24 23:50:48 +02:00
Nathan Adams ce714b92b6 desktop: When git info is unknown, don't show it 2023-05-24 23:50:48 +02:00
Nathan Adams cd54dc3bc7 desktop: Fix crash on minimize 2023-05-24 23:50:48 +02:00
Nathan Adams 8acd3e653a desktop: Use scale factor to determine menu height 2023-05-24 23:50:48 +02:00