ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.72k stars 816 forks source link

3D Logic 2 (AS2) Site Lock check blocks game in Ruffle but not Flash Player #9967

Open TomFulp opened 1 year ago

TomFulp commented 1 year ago

Describe the bug

https://www.newgrounds.com/portal/view/408447/format/flash?emulate=flash

3D Logic 2 has a site lock feature that allows it to run on Newgrounds. When loaded in NG Player (Flash Player) it works, however when loaded in Ruffle it fails.

Expected behavior

Game should proceed past the site lock check and to the menu.

Affected platform

Self-hosted version

Operating system

Windows 11

Browser

Chrome version Version 110.0.5481.178

Additional information

No response

Lord-McSweeney commented 1 year ago

Strangely, opening the SWF in a new tab with the Ruffle extension does not trigger the site lock.

n0samu commented 1 year ago

This isn't really Ruffle's bug - it's a faulty sitelock. Here is the code:

        if(_url.indexOf("http:") == 0 && playerIsChecked)
        {
            initGame = true;
        }

The sitelock check only passes if the SWF URL starts with http:. Newgrounds uses HTTPS URLs now, so the sitelock check fails.