-
Hi,
In many games, when you select 'Multiplayer', it will list all of the games that are currently running on the LAN.
I could be wrong, but I think this is done by sending out a network wide packet, and the computers which are listening for this packet (thus are running the game) will respond.
How can this be coded in VB?
-
Well, if the game uses TCP/IP, then it is sending out a UDP broadcast packet.
If the game is using IPX, then it is sending out an IPX packet.
With the tcp/ip end of things, you would use a winsock control. Set the remotehost = 255.255.255.255
Then send some data.
The data should go everywhere.
But, if there is a switch on the network it might stop the data. On my network here there is a switch, and it will only let the first broadcast packet through.
Im not sure how to send IPX data using VB.
One thing you might want to look into, is the DirectPlay features of DirectX. They allow for this kind of thing. If you're already using DirectX in your game, then I'd use DirectPlay.
- jamie
-
Yup...he's right...
Most of the games nowadays with this functionality just utilize DirectPlay. Using DirectPlay, you can find out all of the available ways the user can play/host using a simple "service provider" query.
I highly recommend using a simple API like DirectPlay unless you really want to get "down and dirty" with your computer game making.