Retrieve & Send Data - MySQL Server from C2?

0 favourites
  • 7 posts
From the Asset Store
Create your own wss server and ws server with ssl and without ssl.
  • 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!

  • 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..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • 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.

  • 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.

  • 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)

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)