PDA

View Full Version : Storing and retrieving player info



BlueCat
06-01-2003, 10:17 PM
I'm playing with multiplayer stuff at the moment and I'm wondering about the best way to do something.

I want to store information about players on a server (this server actually!) and need to be able to retrieve and update records from a client application. I could use the mysql database that DGDev uses but I would have to use PHP or similar to access the tables and then download the result (is that true?).

I can't run an app on the server so maybe I should FTP plain text files for each user. I'd only be reading and updating these files when my client starts up.

What's the best way to do it?

Armand
06-01-2003, 11:22 PM
I could use the mysql database that DGDev uses but I would have to use PHP or similar to access the tables and then download the result (is that true?).


You could access it directly, depending on how the server is set up.
But I don't think you'd like to give the world access to DGDev database.

Is there any reason why you can't upload an app to the server and run it?

< my 2cents>

This would probibly be the best way. A small app tha does.
Opens the connection to mysql. {behind the firwalling}
Has all the querys you need. {This is then the only thing the know the password}.
Has an open socket, to which you send specific commands from your client. Any thing else it ignores.

Its a small interface{translation} layer. No real 'smarts' in it to make it work.

You can also the trim what is being sent. {slighly less bandwidth required then full querys.}

Client/Server is nicer for security.

< /my 2cents>

Does this help??

BlueCat
07-01-2003, 09:47 AM
Thankyou that does help.




Is there any reason why you can't upload an app to the server and run it?



Only that I don't have a server :( I just want something I can use on free webspace. I could ask the host if they would let me run it, not likely though.

If I want to upload/download files does anyone know of a component that would do this?

TheLion
07-01-2003, 05:31 PM
I only noticed this post now, must have missed it or something. :)

There is a component out there that allows a Delphi application to connect to a MySQL database. If you get that you can work with the db exactly like you do it now with PHP (except for the commands) :)

BlueCat
08-01-2003, 12:18 AM
Unfortunately I would need direct access to mySQL. I can do that on my own machine but the database I want to use is on a server where I would need to connect locally. Using PHP I can connect to the local database because the PHP files are processed on the same server if you see what I mean(the same reason you need to use phpMyAdmin to manage remote databases).

I was thinking of writing some PHP code to fetch data and supplying parameters through the URL. But I think it will be easier to just FTP small text files for each user.

Thanks for your help :P

TheLion
08-01-2003, 09:31 AM
You could write a php page for it and just post the data, however I'm not sure how to open that page using delphi and a socket... You could store textfiles, however that will get pretty big I think, but would work... Best would be to write a gameserver for it though, since you will get a hard task checking if a playername allready exists and better if it's his/hers... :( although you could just download the textfile and check for a password, but I would use some sort of MD5 encryption if I was going to do it that way... :)

I don't know if this will work, but it just popped up in my mind, you could use a textfile database and open it with the ADO components, however I don't know how it handles textfiles on a server without ADO installed, I don't know if you could open that database with them without downloading it first... :(

Zanthos
14-01-2003, 10:36 PM
Hello All!! :)

I'm back, from holiday, and A-Level Pure 2 revision, sorry if it seems like I'm never here :)

Anyway, on with the query:

For my game, players need to know whereabouts the master server is to connect to it and retrieve a list of game servers. I don't have any permanent server I can upload applications to, so I decided to nab some free CGI webspace, namely tripod(hey, it was only an experiment :)), with which to set as my persistant 'meeting point'. On the server I wrote a couple of perl scripts to respond to server list queries from players, and to commands I give it, aswell as new servers registering themselves on the server. This used little bandwidth, didn't require much programming experience, and worked relatively effectively(apart from perl interpreters being a bit slow :)).

BlueCat
31-01-2003, 09:00 PM
Hello All!! :)

I'm back, from holiday, and A-Level Pure 2 revision, sorry if it seems like I'm never here :)

Anyway, on with the query:

For my game, players need to know whereabouts the master server is to connect to it and retrieve a list of game servers. I don't have any permanent server I can upload applications to, so I decided to nab some free CGI webspace, namely tripod(hey, it was only an experiment :)), with which to set as my persistant 'meeting point'. On the server I wrote a couple of perl scripts to respond to server list queries from players, and to commands I give it, aswell as new servers registering themselves on the server. This used little bandwidth, didn't require much programming experience, and worked relatively effectively(apart from perl interpreters being a bit slow :)).

Hi there nice to see you here again (even if I didn't notice for 2 weeks lol :P )

That sounds like an excellent solution. I'm hoping to make something that requires very little technical knowledge to install so expecting someone to set up a server with MySQL and PHP would not work.

What you did is just what I need, a meeting point. Is there a 'ready made' solution for this sort of thing out there somewhere?

Zanthos
03-02-2003, 03:46 PM
I don't know of anything freely available which you could use, but if you need any example code you can have a look how I did it :)

BlueCat
09-02-2003, 11:17 PM
I don't know of anything freely available which you could use, but if you need any example code you can have a look how I did it :)

Thanks Zanthos :)

It looks like the best option is to make a server that connects all the clients.

If I did this, I'd need to upload the server app and run it. But I'm pretty sure that most hosts won't allow that for obvious reasons.

Are there any other options? I'm on a 56k modem here so using my PC as a server is just not going to happen :twisted:

TheLion
10-02-2003, 09:43 AM
Pure theoretically a cgi application or a pl script might work, but I don't dare to promise that! :-S

You could however write a server/client application locally (using localhost) and release the server with your game and if ppl are intereseted they'll run the servers. ;)