Accessing a database from within a full-screen game app

Started by
13 comments, last by ByteMe95 21 years, 10 months ago
I would use Mysql. Sure you''ll need a little trick to hide your username and password. ( you would have to hide the line of code that calls the cgi-script, too).
But who would hack your game ? Or can i win $1.000.000 for the first place?

In mysql you could easally expand your data-table later on, when you would like to have more infos from your users. (fps, win vers.xy, gfx-card, soundcard,...)


Thrust me, i know what i''m doing
Thrust me, i know what i'm doing
Advertisement
I was planning on using mysql.
I looked into the mysql API for C++, MAAADD easy, wow
One problem though, my server does not accept outside conenctions to the db from any app, so it looks like im just gonna have to setup a mysql database and a cgi/php script to access it. So I will have to open a socket to the cgi/php script url and send the data. Sending as GET data should be simple, but I''m trying to figure out how to send POST data for it.

quote:
But who would hack your game ? Or can i win $1.000.000 for the first place?


hehe, you sound like you work for microsoft
Never underestimate the power of a bored computer geek, they''ll be happy to hack anything for no reason, just for personal gratification.

ByteMe95::~ByteMe95()
My S(h)ite
ByteMe95::~ByteMe95()My S(h)ite
quote:Original post by ByteMe95
I was planning on using mysql.
I looked into the mysql API for C++, MAAADD easy, wow
One problem though, my server does not accept outside conenctions to the db from any app, so it looks like im just gonna have to setup a mysql database and a cgi/php script to access it.

Hmm. Sounds a bit strange.. Are you sure you connected using the mysqlrealconnect function? in my sdk-version i had to overwrite it to be able to connect with a username , password and defining a database. all mysqlrealXY functions are for use with db not located on you local machine.
quote:
hehe, you sound like you work for microsoft

Well, i think everybody who ever bought a Windows System is working hard to ceep it running. With the difference that we all don''t get money for it. We have to pay for it.



Thrust me, i know what i''m doing
Thrust me, i know what i'm doing
doing a POST is just as easy as a GET with parameters.

The HTTP RFC should cover it. If I remember correctly, instead of putting your parameters on the end of the URL, you add them as HTTP headers in the request.

Something like:


  POST /foo/highscore.asp HTTP/1.0Score: 100Player-Name: Brannon  


etc.

-Brannon

[edited by - Brannon on June 3, 2002 9:20:37 PM]
-Brannon
I got it working perfectly
Thanks everyone for the help, got just what i wanted


ByteMe95::~ByteMe95()
My S(h)ite
ByteMe95::~ByteMe95()My S(h)ite

This topic is closed to new replies.

Advertisement