ruffle-rs / ruffle

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

Mix Sudoku Light Vol 2 - Error Thrown on loading #10474

Closed desertking closed 1 year ago

desertking commented 1 year ago

Describe the bug

Some weird error. Maybe useful I post it here.

ruffle-player.js:419 Loading SWF file https://www.spiele-umsonst.de/azad/downloads/flashgames/mixsudokulightvol2.swf ruffle_web-wasm_extensions.js:677 ERROR core/src/display_object/movie_clip.rs:2132 Got "RustError("Attempted to call \"\" with 2 arguments (more than 0 is prohibited)")" when constructing AVM2 side of movie clip of type com.conceptis.gen.loader.light::genLightPreloader

Expected behavior

To load and run

Affected platform

Online demo

Operating system

All

Browser

All

Additional information

No response

n0samu commented 1 year ago

Progressed by #10299. The next error is:

ERROR run_frame:run_all_phases_avm2: ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "enterFrame", class: flash.events::Event, ptr: 0x19af7725b20 }) to handler FunctionObject(FunctionObject { ptr: 0x19af6ff9760 }) : TypeError: Error #1088: The markup in the document following the root element must be well-formed.
        at XML/XML::init()
        at XML()
        at XML/XML()
        at com.conceptis.gen.loader.light::genLightInitializer/formatPuzzleName()
        at com.conceptis.gen.loader.light::genLightInitializer/initializeStep()
evilpie commented 1 year ago

We are missing an implementation of the E4X "The Abstract Equality Comparison Algorithm" for XML/XMLList.

evilpie commented 1 year ago
var a = new XML('<family><genealogy code="02" /></family>');
var b = new XML('<xxx family="02"/>');
trace("a.genealogy.@code", a.genealogy.@code);
trace("b.@code", b.@family);
trace("a.genealogy.@code == b.@family", a.genealogy.@code == b.@family); // Equal in Flash
evilpie commented 1 year ago

The error now is

ERROR ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "complete", class: flash.events::Event, ptr: 0x56367a718190 }) to handler FunctionObject(FunctionObject { ptr: 0x56367a8dc820 }) : Error: XML node 0 1 2 3 4 5 6 7 8\type is missing or is not in the correct format

Sadly it looks like the code is auto generated or hidden somehow?

desertking commented 1 year ago

I don't know maybe it's obfuscated or mochi-encrypted?

n0samu commented 1 year ago

Here is the stack trace:

        at com.conceptis.gen.format::genBlockType/fromXML()
        at com.conceptis.sud.format::sudBlockType/fromXML()
        at com.conceptis.sud.format::sudDataType/fromXML()
        at com.conceptis.sud.format::sudPuzzleType/fromXML()
        at com.conceptis.gen.model::genPuzzle/loadXML()
        at com.conceptis.gen.player::genPlayer/init()
        at com.conceptis.sud::sudPlayer/init()
        at com.conceptis.gen.loader::genLoader/run()
        at com.conceptis.gen.loader.light::genLightLoader/onLoadContentComplete()

@evilpie the com.conceptis.gen.format package is contained within the SWF embedded via the following BinaryData tag (and loaded via loadBytes): DefineBinaryData (86: com.conceptis.gen.loader.light.genLightParams_poPlayer) image

evilpie commented 1 year ago

Oh this is great, thanks! I see the problem now.

Edit: The issue is missing support for hasOwnProperty("@attribute") again.

Lord-McSweeney commented 1 year ago

Fixed by #10864.

desertking commented 1 year ago

I have to hover over the numbers in the grid to see them. No error thrown.

desertking commented 1 year ago

And restarting throws this errors:

Loading SWF file https://www.spiele-umsonst.de/azad/downloads/flashgames/mixsudokulightvol1easy.swf ruffle_web-wasm_extensions.js:685 ERROR core/src/avm2/events.rs:419 Error dispatching event EventObject(EventObject { type: "click", class: flash.events::MouseEvent, ptr: 0x1b75a3c }) to handler FunctionObject(FunctionObject { ptr: 0xb5905c }) : TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: pbNeedSave) ruffle_web-wasm_extensions.js:685 ERROR core/src/avm2/events.rs:419 Error dispatching event EventObject(EventObject { type: "click", class: flash.events::MouseEvent, ptr: 0x1c7ca64 }) to handler FunctionObject(FunctionObject { ptr: 0xb5905c }) : TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: pbNeedSave) ruffle_web-wasm_extensions.js:685 ERROR core/src/avm2/events.rs:419 Error dispatching event EventObject(EventObject { type: "click", class: flash.events::MouseEvent, ptr: 0x1b43c3c }) to handler FunctionObject(FunctionObject { ptr: 0xb5905c }) : TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: pbNeedSave) ruffle_web-wasm_extensions.js:685 ERROR core/src/avm2/events.rs:419 Error dispatching event EventObject(EventObject { type: "save", class: com.conceptis.gen.ui::genDialogEvent, ptr: 0x11dc0fc }) to handler FunctionObject(FunctionObject { ptr: 0x1cde9d4 }) : RustError("XML.appendChild is not yet implemented for PrimitiveObject(PrimitiveObject { ptr: 0x1f4d730 })")

n0samu commented 1 year ago

@desertking can you open a separate issue for that? Thanks!