Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Desktop app] Add ability to load SWF-specific settings from configuration file #19325

Closed
Tiagoquix opened this issue Jan 25, 2025 · 11 comments
Closed
Labels
enhancement New feature or request

Comments

@Tiagoquix
Copy link

Tiagoquix commented Jan 25, 2025

When you watch a video using the VLC media player, subtitles are automatically embedded if the subtitles file uses the same name as the original video file (and ends with .srt extension).

A similar thing could be done for Ruffle, either using TXT or TOML files.

For example, there's a game I like to play called Age of War 2, one of the classic Flash games.
To unlock the Insane (maximum) difficulty in-game, I have to use the follwing property:
Spoof SWF URL: http://farm.maxgames.com/ageofwarupdate1MzYx.swf

This could be automated by using the following logic:

SWF file is age-of-war-2-publicOTM3.swf.
SWF-specific settings are stored in age-of-war-2-publicOTM3.txt.

Settings follow the following format:

[network]
custom_base_url =
spoof_swf_url = 
referer_url =
cookie = 
proxy = 
upgrade_http_to_https =                 # accepted values: 0 / disable / false ; 1 / enable / true
tcp_connections =                       # accepted values: 0 / deny ; 1 / ask ; 2 / allow
load_behavior =                         # accepted values : 0 / block / blocking ; 1 / delay / delayed ; 2 / stream / streaming

[player]
max_execution_duration = 

etc. etc. etc.
[...]

When loading the SWF file, if a TXT or TOML file is also found in the same folder with the same name as the SWF file, automatically load the settings from the file or prompt the user to allow loading.

@Tiagoquix Tiagoquix added the enhancement New feature or request label Jan 25, 2025
@kjarosh
Copy link
Member

kjarosh commented Jan 25, 2025

I believe this feature request is fully covered by our Ruffle Bundle mechanism. You can create a Ruffle Bundle, which includes all required files for a movie to run, along with its configuration. See https://github.com/ruffle-rs/ruffle/tree/master/frontend-utils/src/bundle for details.

Currently there's no user interface to create such bundles, they need to be crafted by hand.

@Tiagoquix
Copy link
Author

I didn't even know that existed. Thanks for the info!

I think the only downside of the Ruffle Bundle is that it doesn't seem to allow for multiple files in a same directory, because all config. files would be named ruffle-bundle.toml.

As I see it, it is also not possible to use one Ruffle Bundle file for multiple items, since it's not (apparently) possible to use something like (in a single file):

[bundle.mygame1]
(properties here)

[player.mygame1]
(properties here)

[bundle.mygame2]
(properties here)

[player.mygame2]
(properties here)

@torokati44
Copy link
Member

The idea is that you put every game into its own bundle.

@Tiagoquix
Copy link
Author

Yes, I understand that. But I think my original feature request is also a good idea to implement.

The only thing needed to implement my original suggestion would be to detect {source_swf_file_name}.toml in the same folder, and it would automatically fill the name and url fields required by the [bundle] section of the bundle tool. Therefore, only [player] parameters would be needed.

This way, it still makes it possible to implement my idea without having to deviate too much from the current implementation.

@kjarosh
Copy link
Member

kjarosh commented Jan 25, 2025

@Tiagoquix the idea of Ruffle Bundle is to bundle a movie into one archive file which contains everything. The resulting file (e.g. named some_movie.ruf) contains everything inside, and you can have multiple .ruf files inside one directory with different names. The name of the .ruf file does not matter.

@Tiagoquix
Copy link
Author

With that new information I believe that my original idea would need more changes to be implemented then, since I'm asking for an auto-detected config. file, which is not possible without a .ruf file/bundle (not possible by interacting directly with a SWF file in a simpler way).

Therefore, I think my suggestion can remain opened since my original intention is to have multiple files (one SWF, one TOML) next to each other instead of having to create a bundle.

However, if you guys think this is unnecessary and that the bundle already suffices (and that by doing my suggestion it would create more complications), then feel free to close the issue. Thanks!

@n0samu
Copy link
Member

n0samu commented Jan 25, 2025

Your idea sounds convenient for users, I like it 👍

@kjarosh
Copy link
Member

kjarosh commented Jan 25, 2025

The approach of looking for various files all over the disk is problematic wrt filesystem isolation. The current state of "movies loading other files" produces enough issues, but people at least are aware of single-file vs multi-file movies.

It wouldn't be a problem (maybe despite being non-intuitive) on Windows which does not have any filesystem sandboxing, but it would be on MacOS and Linux.

On top of that, a movie wouldn't consist of a single file, so sharing the movie would always require making an archive on the TX side, sharing it, extracting the archive on the RX side, running the movie, which requires more steps and more things can go wrong. Not to mention that you would have to keep those two files in the same directory at all times, etc.

Personally, I'm against this feature as I think Ruffle bundles are superior to that approach, and it will cause more issues than help in the long run.

Edit: In my opinion, it would be better to implement creating bundles in a simple way (e.g. from a running movie, preserving all settings).

@kjarosh
Copy link
Member

kjarosh commented Jan 25, 2025

See also for instance flathub/rs.ruffle.Ruffle#38. People in general want filesystem isolation fully enabled, and I think it's a good idea, as it improves safety a lot.

@Tiagoquix
Copy link
Author

I agree. In the long term, a simpler way to create Ruffle Bundles would be better than adding my idea which could cause more confusions.

Not that Ruffle Bundles are hard to create; I could create one by reading the documentation, because it seems reasonable, but making it simpler (preferably with an UI) would certainly be good.

With that in mind, would it be OK to change my feature request to something such as "Add an UI to create Ruffle Bundles"? If yes, should I re-use this issue or should I create a new one?

Thanks!

@kjarosh
Copy link
Member

kjarosh commented Jan 26, 2025

There's been a bit of discussion going on here, so I'd preserve that and create a new issue with a proper description which links to this one :)

@Tiagoquix Tiagoquix closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants