Looking for some sort of "ping" function

Posted By: exile

Looking for some sort of "ping" function - 07/27/13 12:25

So I am building a matchmaking system off of the great serverlist example for ANet. I have the majority of it ready but I am missing a key feature, that being the actual matching tongue Here is how the process starts.

- Client searches a database for all matches listed as "open".

- The Client builds a list of the first 8 matches it can find and saves the Host IP addresses to a temp.

- The Client is then supposed to then ping each IP on that list in order and save the ping time to another temp.

- Finally the client then connects to the match which had the smallest ping value. If none of the matches have an acceptable ping (based on the clients own preferences) then the matchmaking process starts over.

I am having trouble with the third step using ANet as I am unable to find any kind of feature that would allow something along the lines of;

var pingTime = ping("255.255.255.255",80); //ping(Ip_address, port);

Obviously that would be making things way too easy but it is a feature that would be pretty useful in any future ANet updates (hint hint wink ). Until then I am trying to find some way to achieve some sort of function that would allow gamestudio to return the ping of an IP address/URL. So does anyone have ay ideas? I tried the whole 'connect, ping, disconnect' thing but its a really messy process.
Posted By: MasterQ32

Re: Looking for some sort of "ping" function - 07/27/13 12:55

Here is an example of how to send a ping with sockets yourself:
http://tangentsoft.net/wskfaq/examples/rawping.html

This should be adaptable to ANet i think...
Posted By: exile

Re: Looking for some sort of "ping" function - 07/27/13 18:25

Thanks for the link, I will try to look into this to see if I cant come up with something. If I do I will definitely share it among my fellow 3DGS peers wink Until then, anyone else have any ideas?
© 2024 lite-C Forums