Daily Lucky Numbers:
8
9
16
25
27
36

Magical Driving doesn't work

Started by Daniel Hofverberg, November 19, 2020, 07:14:19 PM

Previous topic - Next topic

Daniel Hofverberg

The game Magical Driving from Ipsproarcade (one of the sites you link to from here) doesn't seem to work on SMF Arcade, even though it works on their site.
https://ipsproarcade.com/index.php?/ipsproarcade/playgame/25581-magical-driving/

On my installation, I only get a black screen and the Console reports the following JavaScript errors:

Quotelgapi.min.js:20 Uncaught SyntaxError: Invalid or unexpected token
magical_driving.js?1525801996639:1 Uncaught ReferenceError: gamevars is not defined
    at _0xf834x4.<computed>.<computed> [as frame_1] (magical_driving.js?1525801996639:1)
    at a.b._runActions (createjs-2015.11.26.min.js??kversion=1.0.0:17)
    at a.b.setPosition (createjs-2015.11.26.min.js??kversion=1.0.0:17)
    at a.b.setPosition (createjs-2015.11.26.min.js??kversion=1.0.0:17)
    at _0xf834x4.<computed>.c._updateTimeline (createjs-2015.11.26.min.js??kversion=1.0.0:14)
    at _0xf834x4.<computed>.c.advance (createjs-2015.11.26.min.js??kversion=1.0.0:14)
    at _0xf834x4.<computed>.c._tick (createjs-2015.11.26.min.js??kversion=1.0.0:14)
    at _0xf834x4.<computed>.b._tick (createjs-2015.11.26.min.js??kversion=1.0.0:13)
    at _0xf834x4.<computed>.b.tick (createjs-2015.11.26.min.js??kversion=1.0.0:13)
    at _0xf834x4.<computed>.b.update (createjs-2015.11.26.min.js??kversion=1.0.0:13)

Am I doing something wrong, is the game broken or is this particular game not compatible with SMF Arcade?

Chen Zhen


It seems to be working when I test it on WebDev.

vince

I'll test it on my site as well Chen in the morning and report back...

Daniel Hofverberg

Quote from: Chen Zhen on November 19, 2020, 11:08:29 PMIt seems to be working when I test it on WebDev.
Strange - it seems to work fine when I play it on this site as well, but it doesn't work on my site.

Wonder why...? I'm not sure why the JavaScript would result in "gamevars is not defined"...

Chen Zhen

Are you uploading it using the HTML5 script?
There is a setting to enable that in your ACP.

The upload container looks like this:


Daniel Hofverberg


Chen Zhen


Can I see a link to your arcade so I can test playing the game on your website?






























Daniel Hofverberg

Quote from: Chen Zhen on November 20, 2020, 10:23:08 PMCan I see a link to your arcade so I can test playing the game on your website?
Sure. My web site is in Swedish, so you may not understand everything, but here is a direct link to this particular game:
https://www.dubbningshemsidan.se/forum/index.php?action=arcade;sa=play;game=263#playgame

At least for me, the opening screen displays fine as well as the "Loading..." progress bar, but then only a black screen along with the JavaScript errors mentioned in the Console.

All other games I've tested with works fine.


For all pages in the Arcade, the Console also displays this warning:
"The Content Security Policy 'upgrade-insecure-requests' was delivered via a <meta> element outside the document's <head>, which is disallowed. The policy has been ignored."

But I assume that has nothing to do with the problem with this particular game?

Chen Zhen

Quote from: Daniel Hofverberg on November 21, 2020, 06:43:38 AMFor all pages in the Arcade, the Console also displays this warning:
"The Content Security Policy 'upgrade-insecure-requests' was delivered via a <meta> element outside the document's <head>, which is disallowed. The policy has been ignored."

But I assume that has nothing to do with the problem with this particular game?


If you look at the console log in this arcade (SMF 2.1) or perhaps on Ronald's Arcade (SMF 2.0.17) you will see that this error does not occur.
It is likely from another mod you have installed that has the meta tag displaying on all or many pages of your website.

Chen Zhen


In my opinion something is conflicting and perhaps another mod with improper code.
Use trial & error by uninstalling one mod at a time & then go back to your arcade to see if the problem is resolved.
Start with Simple Spoiler.

Chen Zhen

Also you still have your forum set to ISO-8859-1 whereas I mentioned before that your database should be set to UTF-8 Unicode ci & your forum to be set to UTF-8 (and converted).

vince

Works fine for me on mobile also no problem

Chen Zhen

The game has JavaScript containing Hindi including variable names.

JavaScript is a client side language that the browser interprets in the character set of the page.

In this case, Daniel's SMF forum is set to ISO-8859-1 which means its pages are rendered as such. It can't decipher the Unicode characters in one of that game's files and throws an error.

The solution is for Daniel to set SMF to UTF-8 and then convert the database to UTF-8. He previously stated that he converted the actual DB tables to UTF-8 Unicode ci so I assume that step has been completed already. It's a 3 step process but looks as though only the 1st step was completed.

Daniel Hofverberg

Thank you - I had no idea that script used Hindi variable names. I'll look into it. :)

Quote from: Chen Zhen on November 21, 2020, 05:00:30 PMIf you look at the console log in this arcade (SMF 2.1) or perhaps on Ronald's Arcade (SMF 2.0.17) you will see that this error does not occur.
It is likely from another mod you have installed that has the meta tag displaying on all or many pages of your website.
The problem with the Console warning "The Content Security Policy 'upgrade-insecure-requests' was delivered via a <meta> element outside the document's <head>, which is disallowed. The policy has been ignored." does not seem to originate with another mod. I have searched through all files on the entire server for the string 'upgrade-insecure-requests' and the only matches were in ArcadeSources/ArcadeGame.php and Sources/Arcade.php - I assume both of those files originate from SMF Arcade, unless I still have some garbage left from e-Arcade...?

And that warning has most definitely nothing to do with UTF-8, and appears on all pages belonging to the Arcade.

Chen Zhen

Magical Driving does not work because your SMF setting for the browser character set is ISO-8859-1.
The Arcade does insert the meta tag into the head of the document which is where it should be.
I believe another mod is also inserting the tag so perhaps it does not like 2 of the same meta tags so it just gives that generalized warning.

What I can do is either have a setting for the meta tag or make JavaScript insert it if the same one does not exist.
However this has nothing to do with your game not working.