Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

pinging game servers

  • 30-06-2002 10:48pm
    #1
    Moderators, Science, Health & Environment Moderators Posts: 9,035 Mod ✭✭✭✭


    Just wondering what a ping utility uses to ping game servers? If I as a lowly vb programmer wanted to create my own ping tool what would I use. MSDos Ping hardly returns the info you need does it? Do games provide some kind of API? Anyone know?


Comments

  • Registered Users, Registered Users 2 Posts: 1,038 ✭✭✭rob1891


    a ping is a ping. Should be the same in dos, unix, halflife ... or using whatever networking api for whatever language you choose.

    As far as I know.


  • Closed Accounts Posts: 1,322 ✭✭✭phobos


    I have found that the ping utilities in MSDOS varies from Windows distro to distro. Consumer versions of the OS seemed to reveal a greater summary of data as opposed to that of (Business) NT's DOS console.

    But having said that, all should give you the information you need for playing games (ie time it takes for packets to be sent/received to/from server X). It's not like anything serious is happening. Ping is actually implemented on an iterative server model to prove this.

    TBH if there is any other functionality you require or expect, I will admit, that it probably doesn't fall under that catagory of ping functionality, but more precicely complements it. If you are still interested in coding your own ping utility using Visual Basic, you could use the following code:

    http://www.freevbcode.com/ShowCode.Asp?ID=199

    HTH ;)

    ;-phobos-)


  • Registered Users, Registered Users 2 Posts: 1,038 ✭✭✭rob1891


    Hmm, apparently the standard libraries for java don't include a ping function m(*amazed*!!). So I checked to see if vb had anything. From a _very_very_ quick look it seems to are expected to implment the standard (http://www.faqs.org/rfcs/rfc792.html) yourself.

    You can find example code here:

    http://www.mvps.org/vbnet/code/internet/ping.htm

    and from a quick google groups search:
    Magnus Lindhe wrote:
    >
    > I need to do a "internet ping" on other hosts from inside a Visual Basic
    > application. Where can I find information abou this?

    Check out Catalyst Software (http://www.catalyst.com). They have a ping
    ocx included in their Internet Control Pack.

    Jonathan
    jhill@screen.ie

    and this (dunno if the link will work):

    http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=36DAF619.324DEF5A%40cruzio.com&rnum=2


  • Moderators, Science, Health & Environment Moderators Posts: 9,035 Mod ✭✭✭✭mewso


    Ta for the links guys. It answers one problem, how to ping using vb but from a gaming point of view nobody seems to consider one of the basic needs. How does ping tell you the server game type, mod, number of players, max players etc. etc. Is this information returned by a game server and if so is there some way of extracting it from the return?


  • Registered Users, Registered Users 2 Posts: 2,660 ✭✭✭Baz_


    Its not returned in a ping, a ping just returns the same data you sent (afaik), I'm not sure how what you want to do is done, but look at programs like gamespy and the all seeing eye, its definitely possible.


  • Advertisement
  • Closed Accounts Posts: 286 ✭✭Kev


    the ping utility sends an icmp echo request packet and recieves an icmp echo reply, as icmp is at a lower protocol level you will get a lower latency than what is returned by a games network protocol.

    to get the info you want from a game you need to look up the network protocol of the game you want to query, or look at the source code of a program such as qstat. the protocols are usually quite simple.

    i've written programs like this for half life quake and quakeworld in c and perl.
    for example to get some info from a quake server you send it a udp packet containing

    "\x80\x00\x00\x0C\x02QUAKE\x00\x03"

    the server will then send you back a packet containing some info such as map, players, max players etc.

    to get the latency just record the time you sent the packet and the time you recieved the reply and subtract.


  • Registered Users, Registered Users 2 Posts: 2,660 ✭✭✭Baz_


    Me stands corrected


  • Closed Accounts Posts: 286 ✭✭Kev


    nah you are right, the msdos ping that people are talking about is totaly different to a program used to query games servers.

    msdos ping uses icmp, internet control message protocol which is one layer higher than ip

    icmp -> ip

    games use there own methods of communicating which is encapsulated in inside tcp or udp packets, which are also a layer above ip.

    game protocol -> tcp/udp -> ip


  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    Hi musician

    Kev is correct.
    but if you are doing this in vb you might run into a few problems.

    When you ping a server say games1.iol.ie with the required info
    "rules" this returns an array of pointer data with required data in this case a list of rules. This is simple to srot in vb but the problem arises when you try and ping for player stats using "players"

    in this case you get an array of pointers and data structs that need to be mapped in order to extra the data. This is hard to do in VB.
    I'd suggest if u want to do this go and do it in C
    A good program to have a look at is

    http://www.qstat.org/

    you can view the source code


  • Closed Accounts Posts: 1,642 ✭✭✭Dazzer


    Look around http://www.planet-source-code for Half-Life. They have a few example programs with source code and tutorials for you to learn.

    The source will have everything you need including how to ping a HL server and how to get information on the map , players , mod etc.


  • Advertisement
Advertisement