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 / Do you have experience with server coding? I want to check the user health by server.

Author
Message
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 1st Jun 2014 10:34
Up till now I've no idea about sever coding.

The players in my game have health bar, when they play the game, the health bar will decrease, and when time goes by, the health bar will recover. I want to check the health bar by server, because the players can modify the device setting to change local time.

How should I achieve this?

The Miracrea Games
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st Jun 2014 11:41
u can use the http commands.

if u use newer window os u have iis webserver from ms on board.
for this u need php extension (just a setup).
then u have a web folder on harddisc u can put in php scripts.
from php scripts u have database access.
if u develope in php u should use a debugger.
if u do not want use php, maybe try ms .net web development but
this required ms web server.
without "server", if u have your own pc online, u can use
any sdk that handle tcp traffic (socktes).

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 1st Jun 2014 11:58
@Markus, I sent you a email.

I'm still feel confused, maybe I should find a php developer to help me out.

The Miracrea Games
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st Jun 2014 12:08
yes, web development seem complicated.
i had translated your mail for this ball game.

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 1st Jun 2014 13:51
You don't need a Windows server to run PHP. It's fine on Linux servers.

-- Jim - When is there going to be a release?
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 1st Jun 2014 18:01
Hey Halley, you know i always help you, but to do a RPG server is a big work.
I have 3 RPG games, and you know i use server side on ALL games.

I suggest you to save those things in a KeyChain file on the device.
Instead, if you want to use EXP, ENERGY, COINS and other things, you need the server, not the web one, but the PROCESS just like mines.

If you need help, you find me on skype.

Long life to Steve!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st Jun 2014 21:20
Sounds like all you need to do is grab the server time to keep player's health in sync. You can use the local time on the device and query the server maybe every 5 min or something to make sure it's still in sync. If not, throw an out of sync error (should only typically happen if user is cheating).

Connect to your server and retrieve the page:




PHP script would be something as simple as thing:


Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 2nd Jun 2014 05:47
A couple months back I wrote an article for the newsletter on how to do leaderboards. The same idea would apply to health checks or any other data you might want to retrieve.

http://www.thegamecreators.com/pages/newsletters/newsletter_issue_134.html

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Jun 2014 04:36
Quote: "You don't need a Windows server to run PHP. It's fine on Linux servers."

And it also runs fine in Windows if you install Apache (which I have done many, many times).

Ditto for working on a Mac with Apache as the web server.

The first question to deal with is 'where am I hosting this?'.

I don't imagine that you are going to run a server for this from your home.

The alternative is to have an account with someone that does hosting.

I sort of assume that you will want a web site to support the game and have a 'presence' for people to find. And Apple sort of insists on one to provide support for any app you publish with them.

So, assuming you have a basic web site on a decent provider, you probably have what you need to support the game play, in theory.

Cheers,
Ancient Lady
Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 3rd Jun 2014 05:03
That's a good point I forgot. That article also points to some really cheap server hosting that will work well for a small game that needs MySQL and PHP. I think it was $5/month.

xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 3rd Jun 2014 17:35
Yes of course, use linux!

Long life to Steve!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Jun 2014 03:54
If you are given a choice between being hosted on Linux or Windows, absolutely choose Linux (run away from Windows).

I would never use a Windows server for a public site. They are much more easily hacked than Linux servers.

Cheers,
Ancient Lady
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Jun 2014 04:07
Quote: "They are much more easily hacked than Linux servers."

Not if the server is set up correctly

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Jun 2014 05:01
The trick is setting it up properly. And it is sooooo much harder to do with Windows.

Trust me on this, I have had way too much experience dealing with Windows based servers versus Linux/Apache ones.

It is especially bad if the Windows server is using IIS (run away from that as fast as you possibly can).

Cheers,
Ancient Lady

Login to post a reply

Server time is: 2024-11-25 05:32:07
Your offset time is: 2024-11-25 05:32:07