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

[Naval Fighter] Game doesn't start when plane is selected and incorrect level is displayed #7008

Closed
Jmousy opened this issue May 17, 2022 · 6 comments
Labels
bug Something isn't working xml

Comments

@Jmousy
Copy link
Contributor

Jmousy commented May 17, 2022

Describe the bug

Naval Fighter.zip

In Naval Fighter, you need to select a plane to start the game, but clicking does not respond and the game does not progress.

image

Compare it with Adobe Flash Player (original) in the image above, you can see that the displayed stage number and description are different. (Level 5 instead of Level 1, description is different...)

(The two images above are before the start of the first stage, for Ruffle, check it out on Nightly 2022-05-17.)

Expected behavior

The correct information should be displayed and the game should start after selecting the plane.

Affected platform

Self-hosted version

Operating system

Windows 10 21H2

Browser

Google Chrome 101

Additional information

No response

@Jmousy Jmousy added the bug Something isn't working label May 17, 2022
@Toad06
Copy link
Member

Toad06 commented May 17, 2022

Thanks for the report.

This seems to be an issue with the XML parser. The following warning is logged into the console:

Couldn't replace_with_str inside of XML constructor: error while parsing attribute at position 35: Attribute key must be directly followed by = or space


<?xml version="1.0" encoding="windows-1251"?><tag attr1="hello"attr2="world">

A code like this one errors in a browser because of a missing space between "hello" and attr2. This case happens a bunch of times in the XML string of this game.


new XML("<?xml version=\"1.0\" encoding=\"windows-1251\"?><tag attr1=\"hello\"attr2=\"world\">");

This code outputs:

  • in Flash Player:
    <?xml version="1.0" encoding="windows-1251"?><tag attr1="hello" attr2="world" />

  • in Ruffle:
    <tag attr1="hello" />

Sample

@Toad06 Toad06 added the xml label May 17, 2022
@Herschel
Copy link
Member

@relrelb Any interest in fixing this one? Not sure if quickxml can be massaged to handle this.

@relrelb
Copy link
Contributor

relrelb commented May 18, 2022

quick-xml can be patched further, but I think we should better implement our own Flash-compatible XML parser, because this is not the only incompatabilty. For instace, Flash accepts attributes surrounded by single quotes, which is banned per XML spec and rejected by quick-xml.

@Herschel
Copy link
Member

I agree, we will need all of our own XML, HTML, and CSS parsers to match the Flash behavior.

Just a note that AVM2 has a separate XML parser + E4X implementation as well, which I'm fairly certain is more faithful to the spec (though I haven't checked this). The original AVM1 era XML implementation is still accessible in AS3 via flash.xml.XMLDocument.

@Jmousy
Copy link
Contributor Author

Jmousy commented Jul 10, 2022

image

I found another game (Rush Race) from the same developer (Game Team) has a similar problem, so I'll leave it for reference.

rush-race.zip

@n0samu
Copy link
Member

n0samu commented Aug 27, 2023

Fixed by #10471

@n0samu n0samu closed this as completed Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working xml
Projects
None yet
Development

No branches or pull requests

5 participants