• Welcome to Valhalla Legends Archive.
 

[VB] Connection Bridge

Started by Mesiah / haiseM, April 17, 2003, 04:00 AM

Previous topic - Next topic

Mesiah / haiseM

This might be a pretty easy question, the idea seems simple, but every time i try to map out my ideas i get a brain cramp. I was wondering if anybody could give me a semi-detailed explination of how to make a socket listen for a connection, then when receives a connection connect another socket to a remote server, and forward stuff that the first socket receives, and send back any data that the second socket receives from the remote server. I guess a good example would be the old Nullbot, that listened for a connection from a game client, then let u close the client, and just sent idle messages to stay alive, can anybody help me a little on this? i want to do something very similar to the nullbot...
]HighBrow Innovations
Coming soon...

AIM Online Status: 

MrRaza

Ask the creator of Nullbot to help you(if he/she is still around)

Spht

#2
That's quite the basic concept. If you're doing this for a Blizzard game, have one socket listen on port 6112, and another socket ready to connect to whatever Battle.net server. When you load up your game, connect it to self (localhost/127.0.0.1). When socket1 gets attempted connection request, accept it and connect socket2 to Battle.net. Then all data you receive from socket2, send it to socket1 and visa-versa. Any time during this you can close off the game's connection and handle messages received from Battle.net in your program. Note that your program should not reply to SID_PING (0x25) messages received from Battle.net until the game has disconnected. Doing so would result in your connection replying with two SID_PINGs which I believe will result in a boot.