How do I create a player database for online games.

Get help using Construct 2

Post » Fri May 02, 2014 5:08 pm

I am creating an online multiplayer card game and wanted to know how to make a player database. In this player database I want to have the player's alias, e-mail, level status, and current in-game credit. For example, if someone logins to the game using the same e-mail as before, then all of the player's settings will be the same and will updated if anything changes (change in level/ alias, losing credit, etc). Does anyone know how I would go about this? Would I incorporate a PHP file?
B
19
S
3
G
1
Posts: 37
Reputation: 1,433

Post » Wed Jun 18, 2014 6:34 pm

Bump.
B
19
S
3
G
1
Posts: 37
Reputation: 1,433

Post » Wed Jun 18, 2014 8:11 pm

So I can help you with this (and hopefully a few others), but there are a few things we need to be clear on before I go any further....

You will need:
A hosted database set up
-know the DB name/password/IP address
-create a table in that DB, with columns for all of the variables you want to store

An understanding of PHP/SQL/Ajax
-you don't need to be a programming expert, but it is very important to at least understand what the PHP pages will be doing. (You would be amazed at how many people want to use PHP but have no desire to understand how any of it works)

Patience.
-while this is completely doable in C2, it's likely going to take some trial and error to get it working for your exact needs.


I will post an example capx and the required PHP pages when I get home, hopefully it will shed some light on what you will need to do.

Cheers,
Bonesey
B
12
S
2
G
1
Posts: 26
Reputation: 835

Post » Wed Jun 18, 2014 8:54 pm

Nice! I have basic knowledge of mysql, but i do not know how to integrate c2 to it. I'm pretty sure if you guide me in the right direction, I can go from there. Thanks!
B
19
S
3
G
1
Posts: 37
Reputation: 1,433

Post » Thu Jul 24, 2014 3:55 am

I am working on this as well,
I am working along the lines of having 2 layers and to variables 1 for password and 1 for player name
layer 1 having 2 text box, 1 name 1 password and a button.

on click variables 1 and 2 are set from textboxinput1 and 2 ,then ajax is called and fills an array,
if right layer 1 disappears and the player id name score .ect and filled

I am stuck on the ajax line this is where i am at with it.

"http://mywebsite.com/getscoresPLAYERone.php?username=" &playerName & "password=" &password

and how to make it check as it seems to just carry on no matter what password is put in.
B
13
S
4
Posts: 60
Reputation: 1,001

Post » Thu Jul 24, 2014 4:36 am

@Kniggles Your GET string you typed in is missing an argument. You need an "&" symbol just before password in text so the GET string parameters now where the username value stops and password parameter starts

"http://mywebsite.com/getscoresPLAYERone.php?username="&playerName&"&password="&password

In full string view it would like this
[http://mywebsite.com/getscoresPLAYERone.php?username=troublesum&password=12345]
B
20
S
7
G
1
Posts: 221
Reputation: 2,077


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests