WebDev

SMF Arcade => SMF Arcade Support + Plugins => Topic started by: Daniel Hofverberg on November 19, 2020, 07:14:19 PM

Title: Magical Driving doesn't work
Post by: Daniel Hofverberg on November 19, 2020, 07:14:19 PM
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?
Title: Re: Magical Driving doesn't work
Post by: Chen Zhen on November 19, 2020, 11:08:29 PM

It seems to be working when I test it on WebDev.
Title: Re: Magical Driving doesn't work
Post by: vince on November 20, 2020, 12:12:22 AM
I'll test it on my site as well Chen in the morning and report back...
Title: Re: Magical Driving doesn't work
Post by: Daniel Hofverberg on November 20, 2020, 02:46:49 AM
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"...
Title: Re: Magical Driving doesn't work
Post by: Chen Zhen on November 20, 2020, 07:02:32 PM
Are you uploading it using the HTML5 script?
There is a setting to enable that in your ACP.

The upload container looks like this:


Title: Re: Magical Driving doesn't work
Post by: Daniel Hofverberg on November 20, 2020, 09:16:00 PM
Quote from: Chen Zhen on November 20, 2020, 07:02:32 PMAre you uploading it using the HTML5 script?
Yes, I am.
Title: Re: Magical Driving doesn't work
Post by: Chen Zhen on November 20, 2020, 10:23:08 PM

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





























Title: Re: Magical Driving doesn't work
Post by: Daniel Hofverberg on November 21, 2020, 06:43:38 AM
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?
Title: Re: Magical Driving doesn't work
Post by: Chen Zhen on November 21, 2020, 05:00:30 PM
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.
Title: Re: Magical Driving doesn't work
Post by: Chen Zhen on November 21, 2020, 05:06:36 PM

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.
Title: Re: Magical Driving doesn't work
Post by: Chen Zhen on November 21, 2020, 05:21:18 PM
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).
Title: Re: Magical Driving doesn't work
Post by: vince on November 21, 2020, 10:26:02 PM
Works fine for me on mobile also no problem
Title: Re: Magical Driving doesn't work
Post by: Chen Zhen on November 22, 2020, 01:45:43 PM
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.
Title: Re: Magical Driving doesn't work
Post by: Daniel Hofverberg on November 22, 2020, 03:04:41 PM
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.
Title: Re: Magical Driving doesn't work
Post by: Chen Zhen on November 22, 2020, 04:30:34 PM
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.
Title: Re: Magical Driving doesn't work
Post by: Daniel Hofverberg on November 22, 2020, 08:44:01 PM
I have a problem with another game, which doesn't start either; Jungle Highway Escape. The opening screen shows, but then the "Loading" screen never appears.
https://ipsproarcade.com/index.php?/ipsproarcade/playgame/25562-jungle-highway-escape/

And on my site:
https://www.dubbningshemsidan.se/forum/index.php?action=arcade;sa=play;game=256;#playgame

Does that also have to do with UTF-8/ISO-8859-1, or is it a different issue? At a first glance, it looks like a different problem to me.

From the Console:
QuoteUncaught DOMException: Blocked a frame with origin "https://www.dubbningshemsidan.se" from accessing a cross-origin frame.
Access to internal resource at 'https://www.dubbningshemsidan.se/felhantering.php' (redirected from 'https://dubbningshemsidan.se/forum/Games/JungleHighwayEscape_Origon/gamedata/JungleHighwayEscape_Origon/manifest.json') from origin 'https://dubbningshemsidan.se' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

To me it looks like the game is trying to access https://dubbningshemsidan.se instead of https://www.dubbningshemsidan.se; I e without the leading www - which of course won't work as it would technically be a different domain.
Title: Re: Magical Driving doesn't work
Post by: Chen Zhen on November 22, 2020, 09:09:09 PM
The arcade has a setting for the url, ensure its root url (prior to /Games) is set to your canonical url.
Title: Re: Magical Driving doesn't work
Post by: vince on November 22, 2020, 10:30:10 PM
Good times lol
Title: Re: Magical Driving doesn't work
Post by: Daniel Hofverberg on November 23, 2020, 02:15:20 AM
Quote from: Chen Zhen on November 22, 2020, 09:09:09 PMThe arcade has a setting for the url, ensure its root url (prior to /Games) is set to your canonical url.
My "Url To Games" setting in the Arcade has the correct URL, including www; but this particular game doesn't seem to acknowledge that.

Does anyone else have the same problem with Jungle Highway Escape?
Title: Re: Magical Driving doesn't work
Post by: origon on November 23, 2020, 03:14:16 PM
It's working fine on my smf arcade
Title: Re: Magical Driving doesn't work
Post by: Chen Zhen on November 23, 2020, 08:52:48 PM
Quote from: Chen Zhen on November 21, 2020, 05:21:18 PMAlso 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).


You seem to be ignoring this even though it's stated during installation, on the arcade info page & I've also mentioned it directly a few times now.
For some reason you don't seem to understand the importance of having your forum set up to use UTF-8 when hosting these HTML5 games.
This will cause problems with some games and should be done prior to reporting any other issues.
EhPortal 1.39.6 © 2024, WebDev