Results 1 to 9 of 9

Thread: DirectPlay and searching for hosts

  1. #1

    DirectPlay and searching for hosts

    Has anyone here used DirectPlay? I'm making some DirectPlay components for my own use and I found this interesting bit. If you enumerate hosts, you can optionally specify a host to search. Using '127.0.0.1' or 'localhost' will only search the local machine, for example. If you do not specify a host, then it does a broadcast over the LAN which should rightly include the local machine. But here's the catch. If you do not have a network cable plugged in, the search will not find the local server. Plug the network cable in to a hub and it will find the local server.

    Just thought I'd share.

  2. #2

    DirectPlay and searching for hosts

    With windows 2000 the network IP 192.168.0.40 (in my case) is not enabled until like you said, the Cat5 is connected to a hub. When you ask to search the LAN, you won't find the local machine which will DirectPlay will assume to be using your LAN IP, not the localhost.

    In my game i'm using Winsock TCP for the data sending and UDP broadcast for locating games on the connected LAN. I'm also experimenting using a master server(nothing special, just my computer when I'm connected to the internet), to enable locating of master servers(works by querying a perl script located on tripod via HTTP ).

  3. #3

    DirectPlay and searching for hosts

    I don't quite see how you could be attached to a network without having the cable plugged in.
    [size=10px][ Join us in #pgd on irc.freenode.net ] [ Sign the Petition for a Software Patent Free Europe ][/size]

  4. #4

    DirectPlay and searching for hosts

    You normally don't need a network cable to make your computer talk to itself using the loopback address. I think it's kind of odd, even for a microsoft machine!
    Do it by the book, but be the author!
    <br />
    <br />Visit the Lion Productions website at:
    <br />http://lionprod.f2o.org

  5. #5

    DirectPlay and searching for hosts

    True, there is always a network present. It's called loopback and is represented by the address 'localhost' or 127.0.0.1.

    I always thought TCP would be too slow for data transmission during gameplay. The guaranteed delivery of TCP would cause tremendous slowdowns when it has to request a resend of out-of-order or missing packets.

  6. #6

    DirectPlay and searching for hosts

    TCP is quite fast, I'm always amazed how fast we can deliver a single line text message over the internet these days.

    I used TCP for my chessgame, however the data that had to be send over the socket was very tiny compared with other games, so that's not an honest comparison! I think TCP is fast enough to be used over a LAN, a lot of games seem to do it, although a lot of games seem to be using the IPX protocol too, dunno why. UDP is a nice and fast protocol, but you'll have to do some sort of CRC checking yourself to ensure that the package arrived the same way as it left the senders socket!

    A plus of TCP packages is that they arrive in the same order (well they are placed in the correct order by a lower layer than the software layer I believe), however with UDP the packages can arrive in a random order and they aren't placed in the correct order by any network layer, so you'll have to solve that too and if a datagram is lost you'll have to re-request it too, but even then it's faster then TCP, due to the size of the datagram, only a lot more work to implement!

    But knowing you, you knew at least half of this stuff allready!
    Do it by the book, but be the author!
    <br />
    <br />Visit the Lion Productions website at:
    <br />http://lionprod.f2o.org

  7. #7

    DirectPlay and searching for hosts

    Depending on the game type, you can usually drop packets and keep going because subsequent packets will make up for the missing packet. A fast-paced game such as a first-person shooter for example does not want to rely on TCP to get the packet order correct. The game should just ignore the out-of-order or dropped packets and continue on. A chess game however does not need minimum latency and can quite easily deal with the extra few milliseconds taken for TCP's guaranteed delivery.

    I have found that not many games are using IPX these days. IPX was quite popular a couple of years ago for LAN games, but this popularity seems to be waning in favour of TCP/IP. DirectPlay and other alternatives such as HawkNL can povide guaranteed delivery using UDP, but they also can not get around the delays that guaranteed delivery may cause.

  8. #8

    DirectPlay and searching for hosts

    You all seem very expeirenced in networking.

    I have a simple question, that I cannot get answered.

    I've been using the dxplay components for a while now, and how do I connect without having to type in the ip address in the pop up box?
    Like when I call getSessions, it pops up a box to type the ip in. How can I create it so the Ip is hard coded in, or typed into an EditBox?

    (It should be so simple, yet cannot figure it out)

  9. #9
    Anonymous
    Guest

    DirectPlay and searching for hosts

    Quote Originally Posted by Kas
    You all seem very expeirenced in networking.

    I have a simple question, that I cannot get answered.

    I've been using the dxplay components for a while now, and how do I connect without having to type in the ip address in the pop up box?
    Like when I call getSessions, it pops up a box to type the ip in. How can I create it so the Ip is hard coded in, or typed into an EditBox?

    (It should be so simple, yet cannot figure it out)
    ----------------------------------------------------------------

    I'm trying to do the same thing...

    Any code examples (for providing a DXPlay component with all of the
    necessary parameters -in code- so none of the 'default' dialog boxes
    pop up, would be greatly appreciated

    Richard
    richebbs@nildram.co.uk

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •