ruffle-rs / ruffle

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

AMF: Parameter result must be non-null (event fails to dispatch) #15247

Open teampanfu opened 9 months ago

teampanfu commented 9 months ago

Describe the bug

With certain AMF requests, the following error occurs:

[Panfu.log] remote > send: amfConnectionService.ping => 
ERROR core/src/avm2/events.rs:428 Error dispatching event EventObject(EventObject { type: "timer", class: flash.events::TimerEvent, ptr: 0xc43d858 }) to handler FunctionObject(FunctionObject { ptr: 0x7d37150, name: Ok("com.pandaland.util.manager::TimeoutManager$/onTimer()") }) : TypeError: Error #2007: Parameter result must be non-null.

Here is another example:

[Panfu.log] remote > send: amfActionService.performAction => 98010,fireworks
ERROR core/src/avm2/events.rs:428 Error dispatching event EventObject(EventObject { type: "fireworksSent", class: com.pandaland.events::AvatarEvent, ptr: 0xb1448f0 }) to handler FunctionObject(FunctionObject { ptr: 0x9a12978, name: Ok("com.pandaland.mvc.view.avatar::AvatarMediator/onFireworksSent()") }) : TypeError: Error #2007: Parameter result must be non-null.

Expected behavior

There should be no error with these AMF requests and the event should be dispatched successfully.

Content Location

The bug is reproducible on our website, a ping is sent every minute when logged in, and the error is also output with every AMF request for the ping.

Affected platform

Self-hosted version

Operating system

Windows 11

Browser

Google Chrome 121

Additional information

No response

teampanfu commented 6 months ago

It seems that this also blocks further execution of a function, which unfortunately causes some really annoying problems in the game.

It would be great if someone could take a look at this when they have time.