What do I wrong?

Get help using Construct 2

Post » Mon Aug 08, 2016 10:58 am

Hi,

I know php/html, but I have never build a game before.

So 4 weeks ago I found/bought Construct 2,
from that moment I have read a lot of tutorials, because I want to learn how to make a game.

I have bought some game kits and started my first game, a slot machine (Multi line)
The game works with a MySQL database, and I tested it every time trough: Microsoft EDGE (localhost)
When I click spin, database is successfully updated, so no problems.

I think, Yes my first game! But it's only localhost until now.

So I did export my game to html5 and uploaded the game to the server. And here is my problem.

When I visited the link: http://sksdt.com/games/mafia-slot/
-----------------------------
- Microsoft EDGE (MySQL will not update, select is working!)
- IE (Same as Microsoft EDGE)
- Chroome (Same as Microsoft EDGE)
- Safari (Same as Microsoft EDGE)
- FireFox (Yes this works great!)

So with this problem in my mind, I did a test with localhost
I opened the preview every time inside a other browser.
-----------------------------
- Microsoft EDGE (Yes this works great!)
- IE (MySQL will not update, select is working!)
- Chroome (Same as IE)
- Safari (Same as IE)
- FireFox (Same as IE)

Here is my capx file: http://sksdt.com/games/construct/slot-game.capx

I can't find any similar problems on the net.
Can someone tell me what I'am doing wrong? Or is it a bug?
B
8
S
1
Posts: 9
Reputation: 408

Post » Mon Aug 08, 2016 12:04 pm

without seeing the actual capx, it is more guessing.

- is the php script located on the same domain? (Cross-Domain is restricted)

Also, this exception is raised when running:
Uncaught (in promise) DOMException: Only secure origins are allowed
B
44
S
10
G
8
Posts: 437
Reputation: 6,463

Post » Mon Aug 08, 2016 12:23 pm

Thx for your reply Ubivis

The .capx is actuel, you can download here: http://sksdt.com/games/construct/slot-game.capx
Live version is located at: http://sksdt.com/games/mafia-slot/
Php is on same domain you can download here: http://sksdt.com/games/construct/database.rar
B
8
S
1
Posts: 9
Reputation: 408

Post » Mon Aug 08, 2016 12:26 pm

thanks, no need to download the database script, I just wanted to be sure that the game and the script is on the same domain.
Having a look into the capx and will come back in a few minutes.
B
44
S
10
G
8
Posts: 437
Reputation: 6,463

Post » Mon Aug 08, 2016 12:35 pm

sorry, can't see a mistake in the ajax events. to better know what happens, I would suggest to change the script in a way to return a status code to get sure that the ajax request is successfully triggered.
B
44
S
10
G
8
Posts: 437
Reputation: 6,463

Post » Mon Aug 08, 2016 12:40 pm

ok, the funny thing is it's working on Firefox but all other browsers wil not update the database. Anyway thx for your help
B
8
S
1
Posts: 9
Reputation: 408

Post » Mon Aug 08, 2016 12:44 pm

the game does to tell me, if something does not work (played it using Chrome), that's why I suggested to add a response to the server script and show it in the game.

Back in the days, when I worked with PHP and MySQL (very long time ago), I always had something set up incorrectly in the database as I sent an ID as a string but wanted to save it as a integer. Mostly very dumb problems that were easily fixed, unfortunately I have not worked with MySQL for a couple of years now and feel myself not in the position to have a check on that part of the game. (fingers crossed, that someone else might be able to)
B
44
S
10
G
8
Posts: 437
Reputation: 6,463


Return to How do I....?

Who is online

Users browsing this forum: Malhog and 12 guests