Allegro.cc - Online Community

Allegro.cc Forums » Game Design & Concepts » obtaining a list of servers

This thread is locked; no one can reply to it. rss feed Print
obtaining a list of servers
Milan Mimica
Member #3,877
September 2003
avatar

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
Member #7,616
August 2006
avatar

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
Member #6,152
August 2005
avatar

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

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Carrus85
Member #2,633
August 2002
avatar

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
Member #3,877
September 2003
avatar

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
Member #2,981
December 2002
avatar

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
Member #3,877
September 2003
avatar

Sounds interesting. Keep us informed.

Go to: