ruffle-rs / ruffle

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

Object World Beta: Cannot start game #17067

Open n0samu opened 1 month ago

n0samu commented 1 month ago

Describe the bug

Object World Beta shows nothing but a blank screen after the loading bar completes. The error is:

ERROR ruffle_core::timer: Unhandled AVM2 error in timer callback: ReferenceError: Error #1065: Variable flash.events::NetFilterEvent is not defined.
        at Utils::ibSSGlobals$/init()
        at ib2/placeStuff()
        at MethodInfo-31()

Expected behavior

The game should load.

Content Location

Link to game in Flashpoint's database: https://flashpointproject.github.io/flashpoint-database/search/#c711ca1c-4baa-4869-97e7-d490a17ab859 SWF file: object_world_beta_by_shock_value_d2ky7l8.zip

Affected platform

Desktop app

Operating system

Windows 10

Browser

No response

Additional information

No response

Aaron1011 commented 1 month ago

It looks like Flash player defines an undocumented NetFilterEvent class that we need to implement

evilpie commented 1 month ago

It seems like for some reason this SWF defines a wrapper for every? single class that flash supports. I highly doubt they are actually being used.

torokati44 commented 1 month ago

Finally a valid excuse to flash[sic!] out all the "useless" AS3 APIs! :partying_face:

Lord-McSweeney commented 1 month ago

The function Playground.Entity::ibEntity$/addIncompatibilities does the following lookup of Vector:

getlex Multiname("Vector",[PrivateNamespace(null,"210"),PackageNamespace(""),PrivateNamespace(null,"774"),PackageNamespace("Playground.Entity"),PackageInternalNs("Playground.Entity"),Namespace("http://adobe.com/AS3/2006/builtin"),PackageNamespace("Playground"),PackageNamespace("Playground.Components"),PackageNamespace("Playground.Components.Physical"),PackageNamespace("shockscript"),PackageNamespace("Playground.Group"),PackageNamespace("Playground.Interfaces"),PackageNamespace("Playground.Modules"),PackageNamespace("flash.display"),PackageNamespace("de.polygonal.ds"),ProtectedNamespace("Playground.Entity:ibEntity"),StaticProtectedNs("Playground.Entity:ibEntity"),StaticProtectedNs("Playground.Modules:ibDefaultModuleManager"),StaticProtectedNs("Playground.Modules:ibDefaultModule"),StaticProtectedNs("Object"),PackageNamespace("__AS3__.vec")])

This includes the namespace PackageNamespace("de.polygonal.ds") as well as PackageNamespace(""). In Ruffle, the lookup results in the class de.polygonal.ds::Vector, while in FP, it results in the toplevel Vector class. Fixing this requires us to match FP's lookup behavior exactly.