Retrieve & Send Data - MySQL Server from C2?

Get help using Construct 2

Post » Fri Aug 15, 2014 6:32 pm

API QUESTION - please HELP! :)

Im working on a game for a client of mine whom is also working with a MySQL developer.
The MySQL developer is setting up a server with a table in which I need to read/write variables to.
They want the table on the server side so that the client can modify the table easily,
without the need to mess with the C2 game-side of things.

Basically, I need to read write data like the name of the player, their score, how many times they've played, among other data that can be updated dynamically on the server side,
but used to populate questions on the C2 side of things.

I am look for help in knowing what the BEST method would be to do this?
which objects best fit my scenarios needs?
⦁ AJAX?
⦁ JSON?
⦁ ARRAY?
⦁ DICTIONARY?
Any help you could throw my way would be GREATLY appreciated!
many thanks in advance!
cjuliao
- Father
- Tree Hugger
- Designer, Animator & Game Developer
B
13
S
2
Posts: 56
Reputation: 1,558

Post » Fri Aug 15, 2014 6:39 pm

You are going to have to use Ajax to send a string..
There are some tutorials about communicating with mySQL through Ajax and php in the tutorial section..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Aug 15, 2014 7:28 pm

LittleStain wrote:You are going to have to use Ajax to send a string..
There are some tutorials about communicating with mySQL through Ajax and php in the tutorial section..


hey LittleStain, thank you so much.
I will look into that.

If anyone else has any other suggestions or recomends, I would GREATLY appreciate it!

many thanks in advance!
Carlos
cjuliao
- Father
- Tree Hugger
- Designer, Animator & Game Developer
B
13
S
2
Posts: 56
Reputation: 1,558

Post » Sun Aug 17, 2014 5:28 pm

although I have been on this site for quite a while I am still new to programming games etc. with very little knowledge of programming. I'm in a similar situation right now trying to pass information back and forth to a data base from construct 2. in reading up on everything it seems like ajax is the best way to do this. the only problem I have with this is a security issue when it comes to passing usernames and passwords on my side of things. but in reading up on everything there is another add on I think its called a JAX RSA that might help as far as security and encoding usernames and passwords ect.
B
80
S
9
G
1
Posts: 30
Reputation: 3,866

Post » Sun Aug 17, 2014 6:14 pm

I believe that a previous post recommended not using C2 for passwords and that it was better to use more secure html/php techniques and then to pass to C2 via the browser some access code.. so for example C2 would pass in it's ajax string a user-id and some session-token, and this token is then used to validate against the server which generated the token. there are expansions on this to enhance security.. there's previous posts who talk about this much better than I could.

for everything else, just look up cgi scripting using perl or php, and then you can export the results via XML/JSON outputs which can then be read by C2.
B
7
S
3
G
1
Posts: 184
Reputation: 1,352

Post » Sun Aug 17, 2014 10:05 pm

My mistake I am only pulling a user name from another php script program via the database records. The script itself has its own security and all of my C2 files will also be within this protected directory of the script. But I still dont want to request and pass even a username (no password) back and forth from the database into C2 without it being protected in some way. In looking around I found this plug in AJAXRSA for C2 , which may or may not be the best or of course the only way to protect it but it should work for at least the start of what im doing if not just for testing purposes for now untill I research a better way. The link to this plug-in is here, if anyone else is interested.

http://www.payondev.fr/projet/ajaxrsa/index.html

This plugin will allow you to encrypt data with RSA algorythm in an Ajax request (client side) and decrypt in PHP (server side)
B
80
S
9
G
1
Posts: 30
Reputation: 3,866

Post » Thu Aug 21, 2014 4:12 pm

Hey guys.

I am willing to pay somebody 10 000 euro. if he or she or they, build a solid plugin for construct.

Features:

-Authentication layer
-High score feature
-..


If we are going to do business, we are going to have a talk and discus all the details of it.

Spread the word


Have a good one
B
3
Posts: 5
Reputation: 183


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests