Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HitBox (Kong version): Freeze after completing level #9573

Closed
n0samu opened this issue Feb 14, 2023 · 2 comments
Closed

HitBox (Kong version): Freeze after completing level #9573

n0samu opened this issue Feb 14, 2023 · 2 comments
Labels
avm2 AVM2 (ActionScript 3.0) issues web Issues relating to the HTML5 frontend

Comments

@n0samu
Copy link
Member

n0samu commented Feb 14, 2023

Describe the bug

In the Kongregate version of HitBox, the game freezes after completing a level. This only happens when the game is run directly from Kongregate. The problem seems to be caused by Kongregate's online API SWF (and not by its local "shadow" API SWF). To reproduce the problem with the Ruffle extension, you can open this URL: https://chat.kongregate.com/gamez/0026/3025/live/hitBox_kong_730x550.swf?kongregate_api_path=https%3A%2F%2Fchat.kongregate.com%2Fflash%2FAPI_AS3_d43c4b859e74432475c1627346078677.swf

This error is repeated in the console:
ERROR core/src/avm2/activation.rs:930 TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: ::submit)

Expected behavior

It should be possible to continue the game after beating a level.

Affected platform

Self-hosted version

Operating system

Windows 10

Browser

Firefox 109

Additional information

It's possible to reproduce the same problem in Flash Player by giving the game an incorrect API URL, for example:
https://chat.kongregate.com/gamez/0026/3025/live/hitBox_kong_730x550.swf?kongregate_api_path=https%3A%2F%2Fchat.kongregate.com%2Fflash%2Finvalid.swf

I also noticed that on the Kongregate page, Ruffle is loading the wrong URL for the API SWF:
https://game263025.konggames.com/games/gameshot/hitbox/frame/7fe8db98-d738-48df-bdc4-f531068023ac/https%3A%2F%2Fchat.kongregate.com%2Fflash%2FAPI_AS3_d43c4b859e74432475c1627346078677.swf
I have not been able to figure out why the game loads the wrong URL when run from the Kongregate page. But I found that the game loads the correct URL when run directly from the SWF URL provided in the "describe the bug" section above.

Even when the game successfully loads the API SWF, in Ruffle the problem still occurs.

@n0samu n0samu added bug Something isn't working avm2 AVM2 (ActionScript 3.0) issues labels Feb 14, 2023
@n0samu
Copy link
Member Author

n0samu commented Mar 10, 2023

Now the problem only occurs on the Kongregate game page (https://www.kongregate.com/games/gameshot/hitbox), not on the extension page or in the desktop app. That means it only occurs when the Kongregate API SWF fails to load. And the API SWF fails to load on the Kongregate game page because Ruffle tries to load it via the wrong URL, for some reason. (See the "Additional Information" section above.)

@n0samu n0samu added the web Issues relating to the HTML5 frontend label Mar 10, 2023
@n0samu
Copy link
Member Author

n0samu commented Mar 21, 2023

The problem occurs because Kongregate is passing URL-encoded swfobject_flash_vars directly to Ruffle's parameters variable, when Ruffle takes non-URL-encoded variables. This is a problem with Kongregate's setup, not with Ruffle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
avm2 AVM2 (ActionScript 3.0) issues web Issues relating to the HTML5 frontend
Projects
None yet
Development

No branches or pull requests

1 participant