Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Need help to get started with PHP/MySQL/FTP servers

Author
Message
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 25th Apr 2016 12:03
Hello everybody.
First of all, I have to admit that I know nothing about sending/receving data between a client and a PHP/MySQL/FTP servers, let alone setting them up.

But let's say I want to make a game where the client can upload their scores to such a server, and retrieve other player's scores,
How do I go about doing that?
Do I need to buy a domain or something? What are the tools/commands that I should use?

Please post your guidance to get me started.
Markus
Valued Member
19
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 25th Apr 2016 12:39
often a internet service provider offer this services, search for web hosting. ~ 4 - 10 EURO each month. my provider differ between a linux or windows os.
you can test also local at your pc. u need visiting the websites for a webserver php mysql etc. and install this software at your pc.
also you can look at "Web Platform Installer" from ms.






AGK (Steam) V2.0.18 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
JohnnyMeek
10
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 25th Apr 2016 13:04
You can also use a service like www.parse.com , you just send data via the REST API .

I use it for user account and leaderboards in my own product. https://play.google.com/store/apps/details?id=com.fatleg.kingoslots
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 25th Apr 2016 13:11 Edited at: 25th Apr 2016 13:18
That's a cool looking slot game. Was it made in Tier 2?

Can we send/receive data via Tier1 native AppGameKit HTTP or DBPro FTP commands if we use MySQL or www.parse.com?

Supposing that we want to rent a domain;
Do we even need to use MySQL at all to host data?
Is there a basic example of setting up a webserver and use AppGameKit to communicate with it?
JohnnyMeek
10
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 25th Apr 2016 13:48
It was made with TIER 1. I use the HTTP commands in AppGameKit, but had to use some web code to send PUT commands as you can't do that with AGK.

You could also reference this code I did for PIWIK analytics.

https://forum.thegamecreators.com/thread/215260


hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 25th Apr 2016 13:57
Thanks, I will look into those tools you guys mentioned.

I've never host a webserver before. Just getting ahead of myself, but after we rent a domain, how do we install PIWIK or MySQL to that server?
Any suggestion for which web-hosting service that I should go for?
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 25th Apr 2016 14:28
Quote: "how do we install PIWIK or MySQL to that server?"

You can't. Your service provider should provide MySQL by default, but you wont be able to install anything else to that server, unless you pay the big money for a dedicated server.
JohnnyMeek
10
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 25th Apr 2016 14:29
I use https://www.dreamhost.com/

They also have Subversion built in and unlimited storage and bandwidth.



BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th Apr 2016 14:36
I always point people to this thread. It is DBPro, but the principles are the same...

http://forum.thegamecreators.com/?m=forum_view&t=170586&b=1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 25th Apr 2016 14:48
I use one.com for my website. It got PHP and MySQL. I suggest picking up a book on PHP. They usually cover these topics. It's quite easy and straight forward once you get started.

Use GetHTTPFile() to talk to the server/PHP script.
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 25th Apr 2016 14:57 Edited at: 25th Apr 2016 15:00
Thanks everybody. I'll do my research on them.

This is probably a dumb question, but;
Is HTTP in AppGameKit the same as FTP in DBPro?

And, how fast will the posted data be updated? Is it less than 1 second?
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th Apr 2016 15:15
No, FTP and HTT are different. But DBP had HTTP commands also.

Speed is dependent on your webserver and connection. But don't expect to run a realtime fast-action game with it.

For high scores, it is perfect. Your users will hardly know it is happening. Make an asynchronous HTTP call (there is a command for this), fade out to your High Score screen and you'll be ready to grab the data, disguised as a screen transition.

I posted this earlier for someone. It isn't a standalone piece of code, but it gives you a good starting point

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 25th Apr 2016 15:43
Thank you for the code. Is "www.mysite.co.uk" a real website that we can, err, 'tap in'?

I'm just aiming for a high lag connection (up to 4 seconds), just to roughly update player's position
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th Apr 2016 16:28
You can get free webspace with PHP and a mySQL database. I pay about $5USD a month for mine, but I do a lot more with it.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Markus
Valued Member
19
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 25th Apr 2016 16:54
for local testing there are some bundles.
LAMP / WAMP
https://en.wikipedia.org/wiki/LAMP_%28software_bundle%29
Web Server Wiki
https://en.wikipedia.org/wiki/Web_server
My SQL Database
http://dev.mysql.com/downloads/
Web Server Apache
http://httpd.apache.org/
PHP
http://php.net/
AGK (Steam) V2.0.18 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 26th Apr 2016 16:51
Just wanted to know in advance.
If , lets say, the database had scores for 100 players, which in 10 different countries.

If a client requested a score list from a specific country, will the webserver sent all the 100 scores (and the client need to sort them by themselves)
Or
The webserver can have a script to send the client only the scores from a specific country?
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 26th Apr 2016 17:15
It would probably be best to do that in PHP and just do a database query with a specific country. So it's the MySQL server that does the job. Then the result is much smaller and can be sent faster to the client.
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Apr 2016 18:17
It's basic SQL, based on the parameter you send. For example...

SELECT * from scores WHERE CountryId = 'GB'
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 26th Apr 2016 18:27 Edited at: 26th Apr 2016 18:28
Yeah, what BatVink said. Just pick up a book on PHP and MySQL and you'll learn all the basics in no time. SQL is very handy when it comes to database searches, and very fast too. Or there's probably some online tutorial/course.

Login to post a reply

Server time is: 2024-03-29 12:23:51
Your offset time is: 2024-03-29 12:23:51