Page 1 of 1

save data local - plugin

PostPosted: Tue Jul 10, 2012 11:54 am
by Mark4Media
Hi all,

If this is the wrong forum to post > sorry. I really looked where to post this, but didn't see a good place for it.

Question is: Is there a plugin or another manner to store variables locally on the server, where the game is running.

I need it to make a program that anyone can access and use. If they change something, i want that change to be permanent, so if somebody else is starting the program (from another desktop), he/she will see that change.

Is something like this possible with C2?

Thanks in advance!
MAD

Re: save data local - plugin

PostPosted: Tue Jul 10, 2012 11:58 am
by Ubivis
you don't need a plugin for this, just use Ajax and a backend like perl, php or whatever, that is capable to write data on the server.

Re: save data local - plugin

PostPosted: Tue Jul 10, 2012 5:22 pm
by Mark4Media
[QUOTE=Ubivis] you don't need a plugin for this, just use Ajax and a backend like perl, php or whatever, that is capable to write data on the server.[/QUOTE]

Hi, thanks for your reply. But could you be more specific? What should i do with ajax, perl, php or whatever?

MAD (Mark aka Dark)

Re: save data local - plugin

PostPosted: Wed Jul 11, 2012 7:29 am
by Ubivis
I would say this is better located at the "How to" section of the board, but I do hope this helps:

as JavaScript is not able to write to a server, you need to set up a script (easiest to learn is PHP in my opinion). With PHP you can set up a script that will either write to a file or a database. From your game, you need to set up the Ajax plugin to call you PHP script with the parameters you need.

It would be too much to explain how to set up the script. But how to use the Ajax Plugin is well explained in the manual.
http://www.scirra.com/manual/107/ajax

Re: save data local - plugin

PostPosted: Wed Jul 11, 2012 8:24 pm
by Kyatric
You can check in the how do I FAQ section "AJAX", there are examples listed showing how to make your C2 application communicate with server-side PHP.

Topic moved to the "how do I" forums.

Re: save data local - plugin

PostPosted: Fri Dec 21, 2012 9:06 pm
by Mark4Media
Thanks!