Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Get your games servers list


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 coquinounet   Members   -  Reputation: 147

Like
0Likes
Like

Posted 16 April 2014 - 02:45 PM

I would to know how i can do a list of all servers of my game, i thought try all ips but it will be not optimized so i ask you if there is a better way, thanks icon_smile.gif

 

(i use SDL_Net if you want to know)



Sponsor:

#2 rip-off   Moderators   -  Reputation: 9382

Like
0Likes
Like

Posted 17 April 2014 - 01:43 AM

Trying all IP addresses is not feasible, nor is it reasonable.

For finding LAN servers, you can issue a broadcast a specifically formatted UDP packet to a known port. Each server would be listening on this port, and would respond to such packets with information about how to connect to them.

For finding servers on the Internet, most games have a well known central server which is run by the game's owner. Third party game servers will contact this central server on startup, which registers their details with it. Clients can query the central server for a list of game servers. This central server can also help achieve NAT punch-through, which is a common problem on the public Internet.

#3 hplus0603   Moderators   -  Reputation: 6303

Like
0Likes
Like

Posted 17 April 2014 - 09:59 AM

Simplest thing that works:
Build a service that receives "I'm alive" messages from each game server. When you receive that message, list it as "alive" for the next 10 seconds, using the address you saw as sender of the "I'm alive" message. Have a timer that removes old servers (older than 10 seconds) once a second or so. Have the server re-send the "I'm alive" message every 5 seconds while it still wants to be listed.
enum Bool { True, False, FileNotFound };




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS