PDA

View Full Version : url accessing from within game - common pitfalls?


TheMysteriousStranger
05-19-2006, 05:39 AM
So I'm making my online score system, and I have it set so that it can read php files and submit post data, etc. Now I'm thinking about what needs to be done to make it painless for the user...

Right now the code watches for:

Server unresponsive
404's
unexpected resultsa from the php page
response time outs

What else might I need to watch for? Or should I just make a generic if-error-show-"try again later"-message system?

And while we're on the subject, are there any steps I need to take to make it impossible for people to download the php script from the server?

Indiepath
05-19-2006, 05:56 AM
Painless & secure? You don't see that often : http://www.indiegamebusiness.com/gamedev.inet.php

Raptisoft
05-19-2006, 06:10 AM
Hey Mysterious--
Have you server respond with some tag in the text, like "GOT THIS OKAY" when it all works. Then if you don't get that, just say there was a problem submitting. That covers all bases.

oNyx
05-19-2006, 06:29 AM
An "update required" response code also wont hurt. Well, you might need that at some point. Eg if the score system changed, if you had to add extra stuff for getting in the way of cheaters or something like that.

>are there any steps I need to take to make it impossible for people to
>download the php script from the server?

People cannot download any php scripts through usual means. (They could do that for example if you do something silly like index.php?site=bla.html and print that file straight away w/o sanity checks.)

TheMysteriousStranger
05-19-2006, 10:31 AM
Sorry indiepath - I already knew about iNet, but I just don't think something simple like an online score system is something worth paying for when I can develop my own.

Rapti - that's pretty much how I have it set up now - I have response tag in the headers and the score data in the page. I just wanted to check that there aren't any situations I'm missing that might cause something beyond a normal error. I guess it should be okay as it is.

oNyx - thanks, I hadn't thought about how I would handle updating the score system if needed. I guess I was thinking I would only update the php side of things, but I guess it might become necessary to update the game side too.

I know poeple can't download php scripts through normal means, but I was more thinking about abnormal means :) I don't know if it's possible to get ahold of a php script easily or if most cheaters would simply not bother because it's too much like hard work.

svero
05-19-2006, 10:53 AM
Firewalls.. specifically the built in windows one and zonealarm.. Not sure what can be done about it but I've had lots of games popup a zone alarm dialog behind the full screen and freeze forever waiting for a response etc...

PeterM
05-19-2006, 11:46 AM
Regarding annoying firewall popups, if at all possible, you can try to create your connection before going fullscreen, or you can try to temporarily switch to windowed mode at the same time.

Or just assume that the user knows to set up their firewall previously (and can put up with the annoyance, since it's normal for them).

Not ideal unfortunately...

TheMysteriousStranger
05-19-2006, 12:02 PM
Regarding firewalls - is that a problem specific to certain versions of windows and/or certain graphics APIs? I'm on WinXP SP2, developing in OGL, and using zone alarm the pop-up appears in front of the full-screen game. Is it likely to appear behind the screen on other versions of windows?

PeterM
05-19-2006, 12:41 PM
I believe it's a DirectDraw/Direct3D problem, but I'm not 100% sure.

If you change your display mode using ChangeDisplaySettings instead of getting DirectDraw to do it, and create a full screen window and tell DirectDraw to render in that window (not fullscreen), the problem should go away.

I think.

Captain Nemo
05-20-2006, 01:57 AM
My fullscreen app blocked popup windows until I called AllowSetForegroundWindow(ASFW_ANY). It seems to work now, at least with my calendar program - the fullscreen window is going into the background as soon as the popup comes up. I haven't tested it with Zonealarm but I think it should work.

PeterM
05-20-2006, 02:36 AM
Thanks for the tip, very handy!