obtaining a list of servers
Milan Mimica

What is the best way to store and retrieve a list of IP addresses of the servers that are running a game server?
I have a website that can always be accessed through DNS. Should I code a HTTP request? It that complicated?

Say a can use HawkNL.

Kikaru

I am going to work on something that I suppose is like what you are doing. What I was going to do was use PHP with a database, and access it with cURL

Onewing

One of my friends has had marginal success in creating OverServer. Maybe it can enlighten you on the subject matter, although he uses SDL. :P

Carrus85

Coding an HTTP request shouldn't be too horrendously difficult; it is just a matter of sending a "GET" message to the proper server, with the proper filename specified. You automatically get a dump from the webserver that represents that data (that doesn't even have to be HTML; it can just be a text file).

In short, you can simply do this (given that you have a socket open to the server).

socket.write("GET /myServerList.txt HTTP/1.1\r\nHost: www.myurlhere.com\r\n\r\n")
data = socket.read()
for line in data:
    # parse

Pretty simple stuff, really*

  • the above is untested, but should work.

EDIT: It appears that you need to specify the carriage return in addition to the line feed character. Fixed.

Milan Mimica

The thing is, I've never used sockets directly before. I've always used high level libs. Seems a good thing to start with.

OverServer, yeah looks good, but it's SDL.

BAF

I've been (not very actively) working on my IRC system for this. It does just what you want, a lobby to advertise game servers, chat, organize games, whatever you want, except instead of you needing a server, it uses IRC for all of its communication.

Milan Mimica

Sounds interesting. Keep us informed.

Thread #590173. Printed from Allegro.cc