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?
It seems to be working when I test it on WebDev.
I'll test it on my site as well Chen in the morning and report back...
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"...
Are you uploading it using the HTML5 script?
There is a setting to enable that in your ACP.
The upload container looks like this:
Can I see a link to your arcade so I can test playing the game on your website?
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?
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.
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.
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).
Works fine for me on mobile also no problem
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.
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.
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.
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.
The arcade has a setting for the url, ensure its root url (prior to /Games) is set to your canonical url.
Good times lol
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?
It's working fine on my smf arcade
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.