How do I add a login/signin system?

Get help using Construct 2

Post » Wed Jan 04, 2017 12:07 pm

Message: ChesVCF can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
I want to create a leaderboard, and therefore users have to create an account (to automatically save their scores and send them to the leaderboard database). It is similar to the system used in Clash Royale, there is a leaderboard where you can see the users with the highest scores (trophies).

I know there are many tutorials on how to add a login/signin system or a leaderboard in C2 using a MySQL database and AJAX, but I have red them all and they are all obsolete. I think the problem is you need to use mysqli instead of mysql, and the code in the PHP is different.

I decided to follow the steps written in this tutorial to create the login system https://www.scirra.com/tutorials/525/si ... ase?page=2 and search the code for the new PHP in other tutorials (outside scirra toutorials) but none of them worked.

In this tutorial on how to create a leaderboard https://www.scirra.com/tutorials/4839/c ... e-4?page=2 the updated code for the getscores.php was posted in the comments and it works fine, but there is stil the updated savescores.php missing.

Could anybody kindly provide the missing codes or update the obsolete tutorials (most of them are many years old)? Not only for me, because there are many many people having the same problem. It is a very common problem.

Thank you for your help :)
B
18
S
5
Posts: 127
Reputation: 1,482

Post » Wed Jan 04, 2017 6:26 pm

Actually, I'd go with @rexrainbow 's firebase plugin.
It's really awesome.
It provides an actual account system where you can register with your e-mail address, get a proper username and connect that with a database.
No need to learn SQL or anything.

If you want, I can send you a .capx of how it works.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Wed Jan 04, 2017 7:40 pm

@randomly please send my to, capx file...
B
17
S
6
G
2
Posts: 37
Reputation: 1,857

Post » Wed Jan 04, 2017 8:14 pm

Thank you for your reply, @randomly :)
I didn´t know about this plugin, maybe you could post the .capx here, so everybody can download it.
B
18
S
5
Posts: 127
Reputation: 1,482

Post » Wed Jan 04, 2017 8:59 pm

Document, plugin and sample capx are included.
Leaderboard (old document), but firebase does not have excellent query.
B
108
S
26
G
259
Posts: 4,430
Reputation: 145,679

Post » Wed Jan 04, 2017 9:07 pm

@rexrainbow Thanks.
@db3344 @ChesVCF Look at rex's .capx's, they are more compact and helpful.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Wed Jan 04, 2017 9:49 pm

ImageImage
B
102
S
45
G
22
Posts: 772
Reputation: 21,493

Post » Thu Jan 05, 2017 11:53 am

Message: ChesVCF can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
Thank you, @rexrainbow

I downloaded all the plugins and the sample .capx, but when I tried to run it I got this error:

Javascript error!
Uncaught Error: FIREBASE FATAL ERROR: Cannot parse Firebase url. Please
use https://<YOUR FIREBASE>.firebaseio.com
htttp://localhost:5000/firebase.js, line 45 (col 272)
B
18
S
5
Posts: 127
Reputation: 1,482

Post » Thu Jan 05, 2017 12:41 pm

@ChesVCF

Try to register an account of firebase, then get your Firebase url
B
108
S
26
G
259
Posts: 4,430
Reputation: 145,679

Post » Thu Jan 05, 2017 4:14 pm

Message: ChesVCF can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
It worked, but now I have another error when trying to create an account @rexrainbow:

Javascript error!
Uncaught Error: This custom Firebase server (`frebaseapp.com´) does not
support delegated login.
htttp://localhost:50000/firebase.js, line 158 (col 324)
B
18
S
5
Posts: 127
Reputation: 1,482

Next

Return to How do I....?

Who is online

Users browsing this forum: Demkamen, Yahoo [Bot] and 13 guests