Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Storing and retrieving player info

  1. #1

    Storing and retrieving player info

    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?

  2. #2

    Storing and retrieving player info

    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??

  3. #3

    Storing and retrieving player info

    Thankyou that does help.

    Quote Originally Posted by Armand

    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?

  4. #4

    Storing and retrieving player info

    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)
    Do it by the book, but be the author!
    <br />
    <br />Visit the Lion Productions website at:
    <br />http://lionprod.f2o.org

  5. #5

    Storing and retrieving player info

    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

  6. #6

    Storing and retrieving player info

    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...
    Do it by the book, but be the author!
    <br />
    <br />Visit the Lion Productions website at:
    <br />http://lionprod.f2o.org

  7. #7

    Storing and retrieving player info

    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 ).

  8. #8

    Storing and retrieving player info

    Quote Originally Posted by Zanthos
    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 )

    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?

  9. #9

    Storing and retrieving player info

    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

  10. #10

    Storing and retrieving player info

    Quote Originally Posted by Zanthos
    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:

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Comodo SSL