Open wsxarcher opened 4 months ago
A very long time is spent to iterate over the avm2 orphaned objects in run_inner_goto_frame. I tried to skip all the orphans or make Avm2::cleanup_dead_orphans(context); clean also the ones placed_by_actionscript and it loads really fast but then when clicking to play the game some objects by name cannot be found.
2024-05-30T15:50:12.007442Z ERROR ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "click", class: flash.events::MouseEvent, ptr: 0x19b56ac3d30 }) to handler FunctionObject(FunctionObject { ptr: 0x19b5ada9cf0, name: Ok("hud.item::Button/onMouseClick()") }) : TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: getChildByName)
at iriysoft.ui::ContainerButton()
at hud.item::Button/initButton()
at hud.item::Button()
at gui::GameScreen/constructButton()
at gui::GameScreen/createButton()
at gui::ChooseProfileScreen/createSlot()
at gui::ChooseProfileScreen/initButtonsBlock()
at gui::GameScreen/initGameScreen()
at gui::ChooseProfileScreen/initChooseProfileScreen()
at gui::ChooseProfileScreen()
at Main/gotoChooseProfileScreen()
at Main/onActivateTitleScreenButton()
at Function/apply()
at iriysoft.core::Signal/dispatch()
at gui::GameScreen/dispatchButtonIDClick()
at gui::GameScreen/onButtonClick()
at Function/apply()
at iriysoft.core::Signal/dispatch()
at hud.item::Button/onMouseClick()
So probably those objects are loaded via as3 and wrongly executed multiple times but they need to still be alive by the gc
Describe the bug
Stuck during loading
(stack trace seems similar to https://github.com/ruffle-rs/ruffle/issues/16488)
Expected behavior
Load the game
Content Location
https://www.4399.com/flash/97801.htm
Affected platform
Browser's extension
Operating system
Window 11
Browser
Edge/Chrome 125
Additional information
This game is part of a bigger effort to support 4399.com games. There might be other issues with this website, from how it handles Flash checks and many CORS issues. Unfortunately, some games cannot be easily debugged on desktop because the swf download other swf or do requests while logged in.
If Ruffle is not detected try to reload the page multiple times because of the known race condition on the Flash check. To avoid refreshing try this Tampermonkey user script 一键下载 flash 游戏 (greasyfork.org)
To solve these issues refers to previous issues such as:
--disable-web-security
or use https://chromewebstore.google.com/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf--referer "https://www.4399.com"
, the correct--spoof-url
(usually the page link) and--base
which is the relative URL where other resources are fetched.